On Wed, 20 Aug 1997, Jeremy Elson wrote: -+Maybe I'm misunderstanding how the patch works... for some reason, I -+thought it always rounded the request up to the next highest power of -+2. I figured the reason a 12288 byte request was filled by 32K -+(instead of 16K) was because a 32K buffer already existed in the -+buffer pool and was the first one that aquire_buffer() found that was -+>= 12288. From what I can tell (and it may not be accurate, since I've not bothered to look at the patch), the patch only rounds up to 128 when you request a buffer smaller than 128. Otherwise, it uses: first, any buffer that is exactly the right size; second, the smallest existing buffer > the requested size; finally, a newly created buffer of the exact size requested. Although, rounding-up might not be a bad idea. It'd certainly reduce the number of malloc() calls (eg., 300 would use a 512 buffer, hence no malloc() of a 300 buffer; later requests for a 512 buffer will get that 512 buffer, thus knocking off another malloc() call). -- Daniel Koepke -:- dkoepke@california.com -:- [Shadowlord/Nether] Think. +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST