apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40939] - pool minimal allocation size should be configurable
Date Fri, 10 Nov 2006 01:34:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40939





------- Additional Comments From mlindner@google.com  2006-11-09 17:34 -------
Ok, so we'll need to make sure the supplied size is a power of 2...

    if ((min_size & 1) || (min_size < MIN_ALLOC))
        new_allocator->min_size = MIN_ALLOC;
    else
        new_allocator->min_size = min_size;

...and instead of using hardcoded BOUNDARY_INDEX and BOUNDARY_SIZE we add them
as fields in apr_allocator_t, calculated as:

new_allocator->boundary_size = new_allocator->min_size / 2;
new_allocator->boundary_index = 0;
int x = new_allocator->boundary_size;
while ((x >>= 1))
    (new_allocator->boundary_index)++;

MAX_INDEX would probably have to be supplied by caller instead of being a fixed
value as it determines the number of buckets (and thus size of largest bucket).

I think that should work...I'll flesh out the patch when I have time...



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message