@@ -22,10 +22,9 @@ Here is the simple ``zend_string`` structure explosed::
22
22
};
23
23
24
24
Like you can see, the structure embeds a ``zend_refcounted_h `` header. This is done for memory management and reference
25
- counting, as you may have learnt by reading the :doc: `./zvals/memory_management ` chapter.
26
25
As the string is very likely to be used as the key of a HashTable probe, it embeds its hash in the ``h `` field. This is
27
26
an unsigned long ``zend_ulong ``. This number is only used when the ``zend_string `` needs to be hashed, aka especially
28
- when used together with :doc: `./hashtables `; this is very likely though.
27
+ when used together with :doc: `.. /hashtables `; this is very likely though.
29
28
30
29
As you know, the string knows its length as the ``len `` field, to support "binary strings". Binary strings are
31
30
strings that embed one or several ``NUL `` characters (\\ 0). When passed to libc functions, those strings will get
@@ -44,7 +43,7 @@ This struct hack must be remembered, as the memory layout looks like with the C
44
43
structure, and may be felt/seen when using a C debugger (or when debugging strings). This hack is entirely managed by
45
44
the API you'll use when manipulating ``zend_string `` structures.
46
45
47
- .. image :: ./zend_strings/ images/zend_string_memory_layout.png
46
+ .. image :: images/zend_string_memory_layout.png
48
47
:align: center
49
48
50
49
Using zend_string API
@@ -53,7 +52,7 @@ Using zend_string API
53
52
Simple use case
54
53
***************
55
54
56
- Like with :doc: `zvals `, you dont manipulate the ``zend_string `` internals fields by hand, but always use macros
55
+ Like with :doc: `../ zvals `, you dont manipulate the ``zend_string `` internals fields by hand, but always use macros
57
56
for that. There also exists macros to trigger actions on strings. Those are not functions but macros, all stored into
58
57
the required `Zend/zend_string.h <https://github.com/php/php-src/blob/PHP-7.0/Zend/zend_string.h >`_ header::
59
58
@@ -216,7 +215,7 @@ zend_string access with zvals
216
215
Now that you know how to manage and manipulate ``zend_string ``, let's see the interaction they got with the ``zval ``
217
216
container.
218
217
219
- .. note :: You need to be familiar with zvals, if not, read the :doc:`./zvals` dedicated chapter.
218
+ .. note :: You need to be familiar with zvals, if not, read the :doc:`.. /zvals` dedicated chapter.
220
219
221
220
The macros will allow you to store a ``zend_string `` into a ``zval ``, or to read the ``zend_string `` from a ``zval ``::
222
221
@@ -333,7 +332,7 @@ Example::
333
332
/* At the end of the process, PHP will purge its interned
334
333
string buffer, and thus free() our "foo" string itself */
335
334
336
- It's all about garbage collection you've learnt about in the :doc: `./zvals/memory_management ` chapter.
335
+ It's all about garbage collection you've learnt about in the :doc: `.. /zvals/memory_management ` chapter.
337
336
338
337
When a string is interned, its GC flags are changed to add the ``IS_STR_INTERNED `` flag, whatever the memory allocation
339
338
class they use (permanent or request based).
0 commit comments