2 ms·
Not having any control on how a library allocates memory is a huge downside, though, and it's something C++ has in my experience largely resolved (at the expens
by qalmakka 6y ago
Not having any control on how a library allocates memory is a huge downside, though, and it's something C++ has in my experience largely resolved (at the expense of ABI compatibility, which is something that IMHO hasn't hindered its adoption that much). Not being able of using stack for short lived objects is also pretty bad for performance, especially if the allocation/deallocation is done in a cycle. I understand the desire of maintaining a stable ABI, but I think this should be optional and at the discretion of the user instead of being shoved down as the only way to use a library. At least, I think such libraries should allow their users to overload whatever malloc/free the library is supposed to use, even though it's less than ideal.