3 ms·
Have you measured the pause times of free()? Because they are not deterministic, and I have met few people who understand in detail how complex it can be in pra
by titzer 5y ago
Have you measured the pause times of free()? Because they are not deterministic, and I have met few people who understand in detail how complex it can be in practice. In the limit, free() can be as bad as GC pause times because of chained deallocation--i.e. not statically bounded.
- cozzyd 5y agoBut you can generally control when free is called.
- alophawen 5y agoThis is true, but for performance's sake, you should not alloc/free in a busy loop, especially not on a real time system. Allocate in advance, reuse allocated memory.
- titzer 5y ago> Allocate in advance, reuse allocated memory. In practice, almost all real-time systems use this strategy, even going so far as to allocate all memory at compile time. The first versions of Virgil (I and II) used this strategy and compiled to C. When doing this, the whole debate of memory safe (automatic) vs unsafe (manual) is completely orthogonal.
- gpderetta 5y agoPeople don't call free from their realtime threads.