3 ms·
> I obviously haven't fully fleshed it out (I'm not writing an RFC here) Whatever you don't state explicitly is assumed to be like the status quo. You've compl
by mike_hock 4y ago
> I obviously haven't fully fleshed it out (I'm not writing an RFC here)
Whatever you don't state explicitly is assumed to be like the status quo. You've completely moved the goalposts with each reply.
> No, you can do [...]
Which a simple is_alloc doesn't help with because the allocator doesn't know if the kernel has actually mapped the memory to a physical page.
This requires help from the kernel, which wasn't stated anywhere, nor was this goal stated anywhere.
> You don't have to change the way in which the compiler works. You can likely do this with some macros.
You can't reflect over a struct in C with macros. You can maybe build something that works with some macro hacks that require you to declare each auto-cleaned field with a special macro.
This again is completely different from your previously stated idea that you just declare a struct with raw pointers and the compiler generates the appropriate free() calls.