Lines Matching refs:arena

36 	zend_arena *arena = (zend_arena*)emalloc(size);  in zend_arena_create()  local
38 arena->ptr = (char*) arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena)); in zend_arena_create()
39 arena->end = (char*) arena + size; in zend_arena_create()
40 arena->prev = NULL; in zend_arena_create()
41 return arena; in zend_arena_create()
44 static zend_always_inline void zend_arena_destroy(zend_arena *arena) in zend_arena_destroy() argument
47 zend_arena *prev = arena->prev; in zend_arena_destroy()
48 efree(arena); in zend_arena_destroy()
49 arena = prev; in zend_arena_destroy()
50 } while (arena); in zend_arena_destroy()
57 zend_arena *arena = *arena_ptr; in zend_arena_alloc() local
58 char *ptr = arena->ptr; in zend_arena_alloc()
62 if (EXPECTED(size <= (size_t)(arena->end - ptr))) { in zend_arena_alloc()
63 arena->ptr = ptr + size; in zend_arena_alloc()
66 …XPECTED((size + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena))) > (size_t)(arena->end - (char*) arena)) ? in zend_arena_alloc()
68 (size_t)(arena->end - (char*) arena); in zend_arena_alloc()
74 new_arena->prev = arena; in zend_arena_alloc()
96 static zend_always_inline void* zend_arena_checkpoint(zend_arena *arena) in zend_arena_checkpoint() argument
98 return arena->ptr; in zend_arena_checkpoint()
103 zend_arena *arena = *arena_ptr; in zend_arena_release() local
105 while (UNEXPECTED((char*)checkpoint > arena->end) || in zend_arena_release()
106 UNEXPECTED((char*)checkpoint <= (char*)arena)) { in zend_arena_release()
107 zend_arena *prev = arena->prev; in zend_arena_release()
108 efree(arena); in zend_arena_release()
109 *arena_ptr = arena = prev; in zend_arena_release()
111 ZEND_ASSERT((char*)checkpoint > (char*)arena && (char*)checkpoint <= arena->end); in zend_arena_release()
112 arena->ptr = (char*)checkpoint; in zend_arena_release()