3 ms·
This is a great example of why _alloc is an abstraction over virtual memory. What this doesn't express is that dealing with page allocation directly can be qui
by duaneb 10y ago
This is a great example of why _alloc is an abstraction over virtual memory.
What this doesn't express is that dealing with page allocation directly can be quite annoying to get correct cross platform. You generally don't want to do that unless a) you're optimizing past the "knuth level" and know you need to for performance (e.g. mapping files to memory), b) you're writing something where you run dynamic code (JIT or dynamic recompilation) or c) you're writing your own allocator and/or using page faults to get some functionality, ala Go's stop-the-world hack.
Basically, don't bypass _alloc unless you have a reason.