static inline void *compiler_alloc_zero(vbscode_t *vbscode, size_t size) { void *ret; ret = heap_pool_alloc(&vbscode->heap, size); if(ret) memset(ret, 0, size); return ret; }
void *heap_pool_grow(heap_pool_t *heap, void *mem, DWORD size, DWORD inc) { void *ret; if(mem == (BYTE*)heap->blocks[heap->last_block] + heap->offset-size && heap->offset+inc < block_size(heap->last_block)) { heap->offset += inc; return mem; } ret = heap_pool_alloc(heap, size+inc); if(ret) /* FIXME: avoid copying for custom blocks */ memcpy(ret, mem, size); return ret; }
static inline void *compiler_alloc(vbscode_t *vbscode, size_t size) { return heap_pool_alloc(&vbscode->heap, size); }