Press "Enter" to skip to content

PHP Internals — A Few Hard-to-Understand Points in Zend Memory Management

A deep dive into zend_alloc: how Zend MM splits memory into small vs large blocks, the small-block free_buckets pointer-packing trick (ZEND_MM_SMALL_FREE_BUCKET), and the large_free_buckets key-tree (indexed by the high bit of the size via bsr) with bitmap-assisted best-fit search. Written because existing references — including TIPI — got it wrong.

Filed in English, PHP应用, PHP源码分析
with 0 Comment

Zend Signal in PHP 5.4

PHP 5.4's new zend signal mechanism (per Rasmus's RFC) lets signal masking work in any SAPI and improves performance. Built on Yahoo's deferred-signal idea, it registers handlers for SIGALRM/SIGINT etc. at startup and defers them via a depth counter (zend_signal_globals_t.depth) instead of repeated sigaction calls, plus a new zend_signal registration interface.

Filed in English, PHP应用, PHP源码分析
with 0 Comment