Post B5emrDxGQ60w9j01ia by evin@gts.yujiri.xyz
 (DIR) More posts by evin@gts.yujiri.xyz
 (DIR) Post #B5emrDxGQ60w9j01ia by evin@gts.yujiri.xyz
       0 likes, 0 repeats
       
       okay, i don't understand why it's okay to use 2 different allocators at once that don't know about each other. don't they conflict, since they're using the same heap? but i just tried using zig's smp allocator in a raylib game and it worked
       
 (DIR) Post #B5emrE8FlEnwho8nqa by lumi@snug.moe
       0 likes, 0 repeats
       
       @evin the allocators will only conflict if there are overlaps in the memory they manage, like two arena allocators using the same arenasystem allocators map memory from the OS all by themselves and then give out bits and pieces of it to whoever needs it. if there are two of them, then they will independently be asking pages from the OS, making them not conflictin case of allocators that use a predefined slice of memory, like arena allocators, they only manage the memory inside of where you say they should. if there are no overlaps there, there will be no problemsi hope this helps
       
 (DIR) Post #B5enGLQrkvpqaPp9Wa by evin@gts.yujiri.xyz
       1 likes, 0 repeats
       
       @lumi ohh i see. thank you
       
 (DIR) Post #B5enHAfVGGqZUa43v6 by lumi@snug.moe
       0 likes, 0 repeats
       
       @evin ofc ​:neocat_heart:​
       
 (DIR) Post #B5fJkfBQ5HkB3z6GFU by pixx@merveilles.town
       1 likes, 0 repeats
       
       @lumi @evin Yep, basically this!The most helpful way to understand is probably to learn how the allocators actually work :)It's a super easy question to understand if you've ever written one or thought about how the memory is managed from the kernel all the way down, much harder if you haven'tSame as e.g. OpenGL is just the magic "put stuff on screen" interface until you learn how the drivers actually work, at which point it's a lot easier to understand what the heck it's actually doing