internals:zend_mm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
internals:zend_mm [2013/01/22 13:25] – [Zend MM] krakjoeinternals:zend_mm [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 17: Line 17:
 PHP is written entirely in C. In C, the programmer is responsible for the allocation and release of memory during runtime.  PHP is written entirely in C. In C, the programmer is responsible for the allocation and release of memory during runtime. 
  
-PHP has very specific requirements for management of memory and many modes of execution; all sharing the same set of requirements. +PHP has very specific requirements for management of memory and many modes of execution; all sharing a common set of requirements. 
  
 The memory manager in PHP, named Zend MM, facilitates these requirements in the same way, whatever the mode of execution, whatever the code. The memory manager in PHP, named Zend MM, facilitates these requirements in the same way, whatever the mode of execution, whatever the code.
Line 40: Line 40:
  void   efree(void* pointer);  void   efree(void* pointer);
  
-They all share prototype and functionality with the standard C implementation, but the memory returned is optimized, and tracked. Tracking memory allows a margin of error not normally present in C programming: memory that is not free'd explicitly will normally be free'd by the implementation at the appropriate time, such as the end of the request, or the end of execution.+They all share prototype and functionality with the standard C implementation, but the allocation is optimized, and tracked. Tracking allocations allows a margin of error not normally present in C programming: memory that is not free'd explicitly will normally be free'd by the implementation at the appropriate time, such as the end of the request, or the end of execution.
  
 Zend provides the following (persistence) functions: Zend provides the following (persistence) functions:
Line 51: Line 51:
 Persistent memory is not optimized, or tracked by the implementation, and should only be used if the developer requires a structure to survive requests. Persistent memory is not optimized, or tracked by the implementation, and should only be used if the developer requires a structure to survive requests.
  
-The following diagrams and explanations provide insight into how and why Zend MM works the way it does.+The following diagrams and explanations provide insight into how and why Zend MM manages the per request memory it allocates.
 ===== Struct zend_mm_heap ===== ===== Struct zend_mm_heap =====
 <code c> <code c>
internals/zend_mm.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1