|
|
|
|
|
by kragen
529 days ago
|
|
I think you mean "literate programming". The arena allocator in Hanson's chapter 6 is an arena allocator, not a "pool allocator" in the sense that 8dcc means, which is to say, a constant-time fixed-size-block allocator. It seems that you had the same reading comprehension problem that I did. The difference is that Hanson's arena allocator can make allocations of any size (his Arena_alloc takes an nbytes argument) and cannot deallocate individual allocations, only the entire arena (his Arena_free takes only an arena pointer as a parameter). A fixed-size-block allocator like the one we are discussing here can only make allocations of a fixed size, but can recycle them individually, not only all at once. (If Hanson's name sounds familiar, it might be because you've read the lcc book.) It may be worth noting that Donald Knuth also invented the font used in 8dcc's article. |
|