123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #include "private.h"
- lub_heap_t *
- lub_partition_findcreate_local_heap(lub_partition_t *this)
- {
-
- lub_heap_t *local_heap = 0;
- if(this->m_spec.use_local_heap)
- {
- local_heap = lub_partition__get_local_heap(this);
- if(!local_heap)
- {
- size_t required;
-
-
- required = lub_heap_overhead_size(this->m_spec.max_local_block_size,
- this->m_spec.num_local_max_blocks);
-
- (void)lub_partition_global_realloc(this,
- (char**)&local_heap,
- required,
- LUB_HEAP_ALIGN_NATIVE);
- if(local_heap)
- {
-
- lub_heap_create(local_heap,required);
- lub_heap_cache_init(local_heap,
- this->m_spec.max_local_block_size,
- this->m_spec.num_local_max_blocks);
-
-
- lub_partition__set_local_heap(this,local_heap);
- }
- }
- }
- return local_heap;
- }
|