small code cleanup
[AROS.git] / rom / kernel / tlsf.h
blobaf307e5594c3abbf654cb8d07f04e49d3c1d173f
1 #ifndef _TLSF_H
2 #define _TLSF_H
4 #ifndef EXEC_TYPES_H
5 #include <exec/types.h>
6 #endif
8 typedef APTR (*autogrow_get)(APTR, IPTR *);
9 typedef VOID (*autogrow_release)(APTR, APTR, IPTR);
11 /* Initialization and memory management */
12 APTR tlsf_init(void * ptr, IPTR size);
13 APTR tlsf_init_autogrow(void * ptr, IPTR size, IPTR puddle_size, autogrow_get grow_function, autogrow_release release_function, APTR autogrow_data);
14 VOID tlsf_destroy(APTR tlsf);
15 VOID tlsf_add_memory(APTR tlsf, APTR memory, IPTR size);
16 VOID tlsf_add_memory_and_merge(APTR tlsf, APTR memory, IPTR size);
18 /* Allocation functions */
19 APTR tlsf_malloc(APTR tlsf, IPTR size);
20 VOID tlsf_free(APTR tlsf, APTR ptr);
21 APTR tlsf_realloc(APTR tlsf, APTR ptr, IPTR new_size);
22 APTR tlsf_allocabs(APTR tlsf, APTR ptr, IPTR size);
24 /* Query functions */
25 IPTR tlsf_avail(APTR tlsf, ULONG requirements);
26 BOOL tlsf_in_bounds(APTR tlsf, APTR begin, APTR end);
28 #endif /* _TLSF_H */