Carved out heaps allocate buffers from a memory pool of with a limited
size. If it frees buffers in deferred manner, the heap may not be
available in a rare condition by unexpected external fragmentations.
Let's think about the following scenario in a 10MB carveout pool:
1. allocated 4MB @ +0MB
2. allocated 2MB @ +4MB
3. freed 1 but defferred
4. freed 2 but defferred
5. allocated 3MB @ +6MB
6. returned buffer 1 and 2 to the heap.
7. allocated 4MB @ +0MB
8. allocation of 3MB failed due to the fragmentation.
Any defferred behavior to the very limited resources is harmful.
Change-Id: I0a64fdec56f0ec1992c20f8ccd50d5c7fbfa8d40
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
-1);
carveout_heap->heap.ops = &carveout_heap_ops;
carveout_heap->heap.type = ION_HEAP_TYPE_CARVEOUT;
- carveout_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE;
return &carveout_heap->heap;
}