3 ms·
The proposed ideas are... fine? I don't know that I would use them, for reasons others have pointed out (I don't wanna have to cast pointers constantly if I don
by ivraatiems 4y ago
The proposed ideas are... fine? I don't know that I would use them, for reasons others have pointed out (I don't wanna have to cast pointers constantly if I don't have to). I am not the most seasoned C/C++ programmer, but I've done my share, and I don't think the use case described here regarding page boundaries has ever come up. Maybe someone else can comment on how common it is when you spend 100% of your time with these languages.
Fundamentally, though, I don't think that "malloc() and free() are missing some features that might improve them for my use case" is the same as "malloc() and free() are bad APIs." They're okay APIs, and they're like anything. Once you know what to expect, you barely think about it anymore.
I do think it would be interesting to hear more about the logic that inspired the original C developers to design the APIs as they did.
- BenFrantzDale 4y agoWhen he says they are bad APIs, I think he means they aren’t a proper basis API for interacting with a memory resource. You can implement malloc and free and realloc and callow in terms of his API with no overhead but not the other way around.