Re:Improving kernel string handling
by TorKlingberg on Thursday May 14, 2015 @01:24PM
(#9546303)
Interesting, but how are the strings free'd?
When the pool is freed, all strings in it get freed. Generally you arrange pools to be per-"request" (in a web server), but it might be per-syscall in a kernel. At the end of the syscall, all strings get freed in one go.
Pools can also have parent/child relations, so when a parent pool is freed, all child pools are freed.
Example code using a pool allocator I wrote about 15 years ago: http://git.annexia.org/?p=rws.git;a=blob;f=process_rq.c;h=a0...