Changeset 1476 in svn for trunk/xcache.c


Ignore:
Timestamp:
2013-11-22T17:33:06+01:00 (20 months ago)
Author:
Xuefer
Message:

updates ChangeLog? & NEWS, updates xcache_get_refcount, adds xcache_get_cowcount

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r1445 r1476  
    177177/* }}} */
    178178
    179 /* {{{ proto int xcache_get_refcount(mixed variable)
    180    XCache internal uses only: Get reference count of variable */
     179/* {{{ proto int xcache_get_refcount(mixed &variable)
     180   XCache internal uses only: Get reference count of referenced variable */
     181#ifdef ZEND_BEGIN_ARG_INFO_EX
     182ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_refcount, 0, 0, 1)
     183    ZEND_ARG_INFO(1, variable)
     184ZEND_END_ARG_INFO()
     185#else
     186static unsigned char arginfo_xcache_get_refcount[] = { 1, BYREF_FORCE };
     187#endif
     188
    181189PHP_FUNCTION(xcache_get_refcount)
    182190{
     
    186194    }
    187195
    188     RETURN_LONG(Z_REFCOUNT(*variable));
     196    RETURN_LONG(Z_REFCOUNT(*variable) - 1);
     197}
     198/* }}} */
     199/* {{{ proto int xcache_get_cowcount(mixed value)
     200   XCache internal uses only: Get reference count of copy-on-write variable or data */
     201#ifdef ZEND_BEGIN_ARG_INFO_EX
     202ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_cowcount, 0, 0, 1)
     203    ZEND_ARG_INFO(0, variable)
     204ZEND_END_ARG_INFO()
     205#else
     206static unsigned char arginfo_xcache_get_cowcount[] = { 1, BYREF_NONE };
     207#endif
     208
     209PHP_FUNCTION(xcache_get_cowcount)
     210{
     211    zval *variable;
     212    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
     213        RETURN_NULL();
     214    }
     215
     216    RETURN_LONG(Z_REFCOUNT(*variable) - 1);
    189217}
    190218/* }}} */
     
    426454    PHP_FE(xcache_get_opcode_spec,   NULL)
    427455    PHP_FE(xcache_is_autoglobal,     NULL)
    428     PHP_FE(xcache_get_refcount,      NULL)
     456    PHP_FE(xcache_get_refcount,      arginfo_xcache_get_refcount)
     457    PHP_FE(xcache_get_cowcount,      arginfo_xcache_get_cowcount)
    429458    PHP_FE(xcache_get_isref,         arginfo_xcache_get_isref)
    430459#ifdef HAVE_XCACHE_DPRINT
Note: See TracChangeset for help on using the changeset viewer.