← Back to context

Comment by 112233

3 hours ago

As an example, user kentonv wrote: "I patched the memory allocator used by the Cloudflare Workers runtime to overwrite all memory with a static byte pattern on free". And compiler would, like, "nah, let's leave all that data on stack".

Or somebody would try to plug in mimalloc/jemalloc or a debug allocator and wonder what's going on.

>As an example, user kentonv wrote: "I patched the memory allocator used by the Cloudflare Workers runtime to overwrite all memory with a static byte pattern on free". And compiler would, like, "nah, let's leave all that data on stack".

Such a program would continue to function as normal; the dirty data would just be left on the stack. If the developer wants to clear that data too, they'd just have to modify the compiler to overwrite the stack just before (or just after) moving the stack pointer.

>Or somebody would try to plug in mimalloc/jemalloc or a debug allocator and wonder what's going on.

Again, that wouldn't be broken. They would see that no dynamic allocations were performed during that particular section. Which would be correct.