diff --git a/docs/doc/utils-en.md b/docs/doc/utils-en.md index 5541c72..67218a8 100644 --- a/docs/doc/utils-en.md +++ b/docs/doc/utils-en.md @@ -198,7 +198,7 @@ - `zval` can be simply understood as the PHP stack - Objects and other data in PHP are represented by `zheap` in C, essentially also residing on the C heap - In simple terms: with `$a=new stdClass()`, `$a` and the address of `new stdClass()` are stored in `zval`, while `new stdClass()` is stored in `zheap` - - `zheap` can be simply understood as the PHP heap + - `zheap` can be simply understood as the PHP heap. It is a memory block allocated by the Zend memory allocator. `zheap` refers to all structures allocated by the memory allocator, such as `zend_object`. - For more on PHP heap data recovery strategies, refer to the PHP official documentation on GC and use functions starting with gc for operations - Stacked coroutines will automatically manage register information and stack data for the context, but heap data is **not concurrently safe** in coroutines - Object pools provide deep copy operations for PHP heap data with `partial support` diff --git a/docs/doc/utils.md b/docs/doc/utils.md index 75ad482..8ebc0bc 100644 --- a/docs/doc/utils.md +++ b/docs/doc/utils.md @@ -196,7 +196,7 @@ - `zval`可以简单理解为PHP栈 - PHP中的对象等数据是在C中以`zheap`体现的,本质上也是在C堆上 - 简单理解:以`$a=new stdClass()`举例,`$a`和`new stdClass()的地址`保存在`zval`其中,而`new stdClass()`保存在`zheap`中 - - `zheap`可以简单理解为PHP堆 + - `zheap`可以简单理解为PHP堆,是通过zend内存分配器分配的内存块,`zheap`代指所有通过内存分配器分配的结构,如`zend_object` - PHP堆的相关数据回收策略,可以详见PHP官方文档关于GC部分,可使用gc开头的函数进行操作 - `有栈协程`对于上下文会自动管理`寄存器信息`和`栈数据`,除此之外的`堆数据`是**非协程并发安全**的 - 对象池提供了对PHP堆数据的深拷贝操作`不完全支持`