Lines Matching refs:reference
14 a reference count to each allocated value, often abbreviated as refcount or RC. Whenever a reference
15 to a value is passed somewhere else, its reference count is increased to indicate the value is now
17 the reference count. Once the reference count reaches zero, we know the value is no longer needed
35 These are either reference types (objects, references and resources) or they are large types that
40 All of the reference counted types share a common initial struct sequence.
45 uint32_t refcount; /* reference counter 32-bit */
61 The ``zend_refcounted_h`` struct is simple. It contains the reference count, and a ``type_info``
71 use the provided macros. There are macros that work with reference counted types directly, prefixed
84 - Returns the reference count.
88 - Increases the reference count.
92 - Increases the reference count. May be called on any ``zval``.
96 - Decreases the reference count and frees the value if the reference count reaches zero.
100 Whether the macro works with non-reference counted types. If it does, the operation is usually a
112 - Returns the reference count.
116 - Increases the reference count.
120 - Increases the reference count.
124 - Decreases the reference count and frees the value if the reference count reaches zero.
128 …Whether the macro works with immutable types, described under `Immutable reference counted types`_.
134 PHP has value and reference types. Reference types are types that are shared through a reference, a
140 In PHP, arrays and strings are value types. Since they are also reference counted types, this
143 we are the values sole owner. However, if the value has a reference count of >1, we need to create a
155 Immutable reference counted types
158 Sometimes, even a reference counted type is not reference counted. When PHP runs in a multi-process
164 immutable and never modifying the reference count. Such values will receive the ``GC_IMMUTABLE``
169 will not check whether the value is immutable before performing the reference count modifications.
177 Sometimes, reference counting is not enough. Consider the following example:
188 When this code finishes, the reference count of both instances of ``stdClass`` will still be 1, as
189 they reference each other. This is called a reference cycle.
210 The ``GC_NOT_COLLECTABLE`` flag indicates that the value may not be involved in a reference cycle.
212 buffer. Only arrays and objects may actually be involved in reference cycles.
219 ``GC_IMMUTABLE`` has been discussed in `Immutable reference counted types`_.