[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.

In the proxies, I see a number of mallocs in libldap.  A better design
would be to avoid (some) libldap calls, or write a new, more efficient
API.  But using lists of chunked objects could help.


Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
Office:   +39.02.23998309
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it