X-Git-Url: http://git.squeep.com/?p=allocwithin;a=blobdiff_plain;f=allocwithin.h;fp=allocwithin.h;h=98ba434642dfc09e94f89f7981f68050baf09844;hp=0000000000000000000000000000000000000000;hb=7e8aaa46a748d9dd227e80f2b4bd709c1fb4fe3b;hpb=966b5d9bd5be10b5a6095aeb649d442cd6c7c901 diff --git a/allocwithin.h b/allocwithin.h new file mode 100644 index 0000000..98ba434 --- /dev/null +++ b/allocwithin.h @@ -0,0 +1,21 @@ +#ifndef __ALLOCWITHIN_H__ +#define __ALLOCWITHIN_H__ + +/** + * $Id$ +**/ + +typedef size_t allocw_id_t; + +struct allocw_region_; +typedef struct allocw_region_ allocw_region_t; + +int allocw_region_init(allocw_region_t *region, size_t size); +int allocw_region_fini(allocw_region_t *region); +int allocw_region_migrate(allocw_region_t *dst_region, size_t dst_size, allocw_region_t *src_region); +void allocw_free(allocw_region_t *region, allocw_id_t id); +allocw_id_t allocw_malloc(allocw_region_t *region, size_t size); +allocw_id_t allowc_realloc(allocw_region_t *region, allocw_id_t id, size_t size); +void *allocw_ptr(allocw_region_t *region, allocw_id_t id); + +#endif /* __ALLOCWITHIN_H__ */