LWN.net Logo

Zeuthen: Writing a C library, part 1

Zeuthen: Writing a C library, part 1

Posted Jun 29, 2011 17:18 UTC (Wed) by cmccabe (guest, #60281)
In reply to: Zeuthen: Writing a C library, part 1 by MisterIO
Parent article: Zeuthen: Writing a C library, part 1

Perhaps you could use a memory pool that was freed later.


(Log in to post comments)

Zeuthen: Writing a C library, part 1

Posted Jun 29, 2011 19:25 UTC (Wed) by MisterIO (guest, #36192) [Link]

Yeah, I'm not saying that you can't use it in general, but that's a good optimization if you've programmed everything. If the classes that are inserted are someone else's code and they don't use the pool, then suddenly you're gonna have various different memory allocation/deallocation patterns. It could be done, is it always better? I don't know, I consider it an optimization. The suggestion would be to code it in a simple way(which doesn't mean dumb), then profile it and see if/where the bottleneck is and try to solve that and so on. Starting with a complex and optimized design that could be not needed, I'm not sure that's always a good choice.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds