3 ms·
> But I know a lot of people get confused and/or don't like having to pass (& thus keep) so much information to the allocator. That's not why I think it' a bad
by lelanthran 3y ago
> But I know a lot of people get confused and/or don't like having to pass (& thus keep) so much information to the allocator.
That's not why I think it' a bad idea.
I prefer the original because:
1. I can pass use the existing `free`, `malloc` and `realloc` implementations. By using a function with a different set of params I cannot do that. The user has to always write the `realloc` function you propose.
2. The interface for free, malloc and realloc is already documented, I don't have to explain to the programmers what constraints are needed for their memory allocator function. Under your proposal the programmer has to now have, and read, the documentation