File: zend_execute_locks.h

package info (click to toggle)
php4 6%3A4.4.4-8%2Betch6
  • links: PTS
  • area: main
  • in suites: etch
  • size: 35,068 kB
  • ctags: 39,148
  • sloc: ansic: 340,486; php: 34,786; cpp: 10,150; sh: 9,010; lex: 2,180; yacc: 1,712; xml: 1,335; makefile: 559; awk: 466; java: 455; perl: 154
file content (32 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef ZEND_EXECUTE_LOCKS_H
#define ZEND_EXECUTE_LOCKS_H

#define PZVAL_LOCK(z) zend_pzval_lock_func(z)

static inline void zend_pzval_lock_func(zval *z)
{
	z->refcount++;
}

#define PZVAL_UNLOCK(z) zend_pzval_unlock_func(z TSRMLS_CC)

static inline void zend_pzval_unlock_func(zval *z TSRMLS_DC)
{
	z->refcount--;
	if (!z->refcount) {
		z->refcount = 1;
		z->is_ref = 0;
		EG(garbage)[EG(garbage_ptr)++] = z;
	}
}

static inline void zend_clean_garbage(TSRMLS_D)
{
	while (EG(garbage_ptr)) {
		zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]);
	}
}

#define SELECTIVE_PZVAL_LOCK(pzv, pzn)		if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }

#endif /* ZEND_EXECUTE_LOCKS_H */