[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: better malloc strategies?



Pierangelo Masarati wrote:
Howard Chu wrote:
As a first cut, I plan to recycle Entry and Attribute structures on our own free lists. That ought to reduce some of the general malloc contention, as well as some degree of the churn. Will be testing this in the next few days.
What about a set of macros that implement *_prealloc(), *_alloc(), *_free() based on the given type? This way, we could save lots of code duplication and (easily?) extend this to other types. I'm thinking of the time and fragmentation in libldap when used by the proxy backends...

Yes, seeing all the redundance between entry_alloc and attr_alloc I was thinking there must be a nice way to condense this. But at the time, I didn't see anything else to apply it to systematically. I'll clean it up a bit now that we know it's worth pursuing this direction.


--
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/