]> mj.ucw.cz Git - libucw.git/blob - ucw/alloc.h
6292471944dccf0d79887c137c52c781166dd825
[libucw.git] / ucw / alloc.h
1 /*
2  *      UCW Library -- Generic allocators
3  *
4  *      (c) 2014 Martin Mares <mj@ucw.cz>
5  */
6
7 #ifndef _UCW_ALLOC_H
8 #define _UCW_ALLOC_H
9
10 struct ucw_allocator {
11   void * (*alloc)(struct ucw_allocator *alloc, size_t size);
12   void * (*realloc)(struct ucw_allocator *alloc, void *ptr, size_t old_size, size_t new_size);
13   void (*free)(struct ucw_allocator *alloc, void *ptr);
14 };
15
16 /* alloc-std.c */
17
18 extern struct ucw_allocator ucw_allocator_std;
19 extern struct ucw_allocator ucw_allocator_zeroed;
20
21 #endif