Lines Matching refs:sa
45 void static_allocator_init(StaticAllocator *sa) in static_allocator_init() argument
47 sa->Blocks = (Block *) emalloc(sizeof(Block)); in static_allocator_init()
48 block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE); in static_allocator_init()
49 sa->num_blocks = 1; in static_allocator_init()
50 sa->current_block = 0; in static_allocator_init()
53 char *static_allocator_allocate(StaticAllocator *sa, zend_uint size) in static_allocator_allocate() argument
57 retval = block_allocate(&sa->Blocks[sa->current_block], size); in static_allocator_allocate()
61 sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks); in static_allocator_allocate()
62 sa->current_block++; in static_allocator_allocate()
63 …block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_… in static_allocator_allocate()
64 retval = block_allocate(&sa->Blocks[sa->current_block], size); in static_allocator_allocate()
68 void static_allocator_destroy(StaticAllocator *sa) in static_allocator_destroy() argument
72 for (i=0; i<sa->num_blocks; i++) { in static_allocator_destroy()
73 block_free(&sa->Blocks[i]); in static_allocator_destroy()
75 efree(sa->Blocks); in static_allocator_destroy()