123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
-
- #ifndef _lub_partition_h
- #define _lub_partition_h
- #include <stddef.h>
- #include "lub/types.h"
- #include "lub/c_decl.h"
- #include "lub/heap.h"
- _BEGIN_C_DECL
- typedef struct _lub_partition lub_partition_t;
- typedef void *lub_partition_sysalloc_fn(size_t required);
- typedef struct _lub_partition_spec lub_partition_spec_t;
- struct _lub_partition_spec {
-
- bool_t use_local_heap;
-
- lub_heap_align_t max_local_block_size;
-
- size_t num_local_max_blocks;
-
- size_t min_segment_size;
-
- size_t memory_limit;
-
- lub_partition_sysalloc_fn *sysalloc;
- };
- lub_partition_t *lub_partition_create(
-
- const lub_partition_spec_t * spec);
- void lub_partition_kill(
-
- lub_partition_t * instance);
- lub_heap_status_t lub_partition_realloc(
-
- lub_partition_t * instance,
-
- char **ptr,
-
- size_t size,
-
- lub_heap_align_t alignment);
- extern bool_t lub_partition_check_memory(lub_partition_t * instance);
- void lub_partition_show(
-
- lub_partition_t * instance,
-
- bool_t verbose);
- void lub_partition_stop_here(
-
- lub_heap_status_t status,
-
- char *old_ptr,
-
- size_t new_size);
- void lub_partition_disable_leak_detection(
-
- lub_partition_t * instance);
- void lub_partition_enable_leak_detection(
-
- lub_partition_t * instance);
- _END_C_DECL
- #endif
|