by josephg · 10y ago · 0 comments
- things of roughly similar total chunk sizes (constant + dynamic part) are stored in one "bucket", laid out contiguously in fixed-size slots, with a little leeway for growth inside
- there are buckets for each existing size of a thing
- if a thing outgrows the slot size of its bucket, it simply migrates to the bucket with the next bigger slot size
Isn't this exactly how many (most?) modern malloc implementations work? ... A series of buckets for different sizes of objects, combined with bitfields or free lists to keep track of which slots in each bucket are free?