4 ms·
The difference is that memory won't do anything under your nose, it can't run arbitrary code by itself. It won't spawn threads, create thread locals, or store d
by SkiFire13 1y ago
The difference is that memory won't do anything under your nose, it can't run arbitrary code by itself. It won't spawn threads, create thread locals, or store data in global variables. And it's normal to track the lifetime of memory, much less the lifetime of code and function pointers passed around.
- immibis 1y agoThe same is true of DLLs. They don't do anything by themselves; they are merely blocks of bytes mapped into memory. Why is tracking the lifetime of a function pointer different from tracking the lifetime of any other pointer? FreeLibrary on Windows unloads libraries when the reference count is zero.
- SkiFire13 1y ago> The same is true of DLLs. They don't do anything by themselves; they are merely blocks of bytes mapped into memory. FYI just loading a DLL can execute code. > Why is tracking the lifetime of a function pointer different from tracking the lifetime of any other pointer? Technically speaking none, but historically this is something that nobody did, so we are full of code that assumes function pointers to have a static lifetime. It's a social problem.
- AstralStorm 1y agoYou could do that, but then you're running valgrind.