00001 /* 00002 * lub_partition.c 00003 */ 00033 #ifndef _lub_partition_h 00034 #define _lub_partition_h 00035 #include <stddef.h> 00036 00037 #include "lub/types.h" 00038 #include "lub/c_decl.h" 00039 #include "lub/heap.h" 00040 00041 _BEGIN_C_DECL 00042 00046 typedef struct _lub_partition lub_partition_t; 00047 00051 typedef struct _lub_partition_spec lub_partition_spec_t; 00052 struct _lub_partition_spec 00053 { 00058 bool_t use_local_heap; 00062 lub_heap_align_t max_local_block_size; 00072 size_t num_local_max_blocks; 00076 size_t min_segment_size; 00081 size_t memory_limit; 00082 }; 00083 00097 lub_partition_t * 00098 lub_partition_create( 00103 const lub_partition_spec_t *spec 00104 ); 00121 void 00122 lub_partition_kill( 00126 lub_partition_t *instance 00127 ); 00152 lub_heap_status_t 00153 lub_partition_realloc( 00157 lub_partition_t *instance, 00162 char **ptr, 00166 size_t size, 00170 lub_heap_align_t alignment 00171 ); 00187 extern bool_t 00188 lub_partition_check_memory(lub_partition_t *instance); 00192 void 00193 lub_partition_show( 00197 lub_partition_t *instance, 00201 bool_t verbose 00202 ); 00209 void 00210 lub_partition_stop_here( 00214 lub_heap_status_t status, 00218 char *old_ptr, 00222 size_t new_size 00223 ); 00224 00225 00226 _END_C_DECL 00227 00228 #endif /* _lub_partition_h */ 00229