@@ -22,9 +22,9 @@ the strings length, along with some other fields. It looks as follows:
2222 };
2323```
2424
25- The `gc` field is used for {doc}`./ reference-counting`. The `h` field contains a hash value, which is
26- used for hash table lookups. The `len` field stores the length of the string in bytes, and the `val`
27- field contains the actual string data.
25+ The `gc` field is used for {doc}`../memory-management/ reference-counting`. The `h` field contains a hash value,
26+ which is used for hash table lookups. The `len` field stores the length of the string in bytes, and
27+ the `val` field contains the actual string data.
2828
2929You may wonder why the `val` field is declared as `char val[1]`. This is called the [struct
3030hack](https://www.geeksforgeeks.org/struct-hack/) in C. It is used to create structs with a flexible size, namely by allowing the last element
@@ -145,7 +145,7 @@ strings.
145145
146146 - - `zend_string_separate(s)`
147147 - Duplicates the string if the reference count is greater than 1. See
148- {doc}`./reference-counting` for details.
148+ {doc}`../memory-management /reference-counting` for details.
149149
150150 - - `zend_string_realloc(s, l, p)`
151151
@@ -167,9 +167,9 @@ Programs use some strings many times. For example, if your program declares a cl
167167` MyClass ` , it would be wasteful to allocate a new string ` "MyClass" ` every time it is referenced
168168within your program. Instead, when repeated strings are expected, php-src uses a technique called
169169string interning. Essentially, this is just a simple ` HashTable ` where existing interned strings are
170- stored. When creating a new interned string, php-src first checks the interned string
171- buffer. If it finds it there, it can return a pointer to the existing string. If it doesn't, it
172- allocates a new string and adds it to the buffer.
170+ stored. When creating a new interned string, php-src first checks the interned string buffer. If it
171+ finds it there, it can return a pointer to the existing string. If it doesn't, it allocates a new
172+ string and adds it to the buffer.
173173
174174``` c
175175
0 commit comments