4 ms·
> Doing a large malloc or causing paging could have slaughtered game execution, especially during streaming. ... it still does ? I had a case a year or so ago
by jcelerier 4y ago
> Doing a large malloc or causing paging could have slaughtered game execution, especially during streaming.
... it still does ? I had a case a year or so ago (on then-latest Linux / GCC / etc.) where a very sporadic allocation of 40-something bytes (very exactly, inserting a couple of int64 in an unordered_map at the wrong time) in a real-time thread was enough to go from "ok" to "unuseable"
- charles_kaw 4y agoi suppose so. modern engines generally have a memory handler, which means that mallocs are usually coached in some type of asset management. you are also discouraged from extending working memory of the scene suddenly. When I was doing gamedev, even then, there was no reason to big malloc because everything was already done for you with good guardrails
- jcelerier 4y agoI mean, if it's a custom memory handler, pool allocator, etc. it's not what people generally mean by malloc, which is the call to the libc function