Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Manual deallocation of a heap???


Sorry, I don't follow.


Are you allocating from and deallocating to a heap?

If so, I've heard that can result in non-optimal results, that would also require dynamic analysis to avoid unacceptable worst cases.


By 'non-optimal results' do you mean heap fragmentation?

If so then yes that's a major concern with dynamic memory allocation in real-time environments. These systems must be designed to run continuously for years at a time and have limited memory, so any allocator that causes non-zero heap fragmentation is right out.

There are allocators that don't do that. One way is to use a pool allocator which allocates fixed-size blocks. Since all blocks are the same size, fragmentation can't occur.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: