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

(ITS#6380) slap_sl_free is too lazy

Full_Name: Howard Chu
Version: 2.4
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (
Submitted by: hyc

slap_sl_free() would only reclaim memory if you were freeing the last allocated
block. If you wanted to free a chain of alloc'd memory you would have to free
them in the exact reverse order of allocation. Calling slap_sl_free() out of
order would be a no-op. This was OK most of the time because a single operation
would seldom live long enough to use much memory. But for long-lived tasks (like
syncrepl or syncprov) it would often run out and allocs would fallback to

sl_malloc.c in HEAD has been changed to mark freed blocks no matter what order
they're freed in. It still only reclaims from the last block forward, but it's
more effective now.