1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #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;
- }
|