int pcre_refcount(pcre *
code, int
adjust);
The pcre_refcount()
function is used to maintain a reference
count in the data block that contains a compiled pattern. It is
provided for the benefit of applications that operate in an
object-oriented manner, where different parts of the application
may be using the same compiled pattern, but you want to free the
block when they are all done.
When a pattern is compiled, the reference count field is
initialized to zero. It is changed only by calling this
function, whose action is to add the adjust value (which may be
positive or negative) to it. The yield of the function is the new
value. However, the value of the count is constrained to lie
between 0 and 65535, inclusive. If the new value is outside these
limits, it is forced to the appropriate limit value.
Except when it is zero, the reference count is not correctly
preserved if a pattern is compiled on one host and then
transferred to a host whose byte-order is different. (This seems
a highly unlikely scenario.)