Hi! > You have commented on <https://bugs.php.net/bug.php?id=72828>: > > | Unless the allocations explicitly use the system allocator (i.e. do > | not use emalloc and variants), do NOT introduce NULL checks. > > Can you please elaborate, why that shouldn't be done. > > Actually, the allocations use safe_emalloc() and emalloc(), > respectively[1]. However, the only client of the function does
These do not need null checks. If e* functions can't alloc memory, they produce fatal error, bail out and do not return. So if it returned, it succeeded. The only reason why it can return null is a bug. In this case we'd prefer it crashing fast - bugs in memory allocator are hard to find, and closer to the source the crash is, easier it to catch it. If pe* or system functions are used, then check may be warranted. -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php