Subject: pool(9) allocator
To: None <tech-kern@netbsd.org>
From: Lennart Augustsson <augustss@cs.chalmers.se>
List: tech-kern
Date: 09/02/1998 12:54:06
I'd like to use the pool allocator for allocating transfer and
queue descriptors in the USB driver.  But I have a problem:
I'd like to initialize certain fields (only one, really) on
a TD when it is first allocated and then I'd like it to survive
even if the TD is freed.  I.e., I'd like to be able to set things
up in palloc() given to pool_create() and then have this field
survive subsequent pool_get()/pool_put().  The current implementation
supports this if the the offset of the field within an item
is large enough (since the pool allocator uses the first part
for a free list).  Would it be reasonable to specify that
pool(9) should behave this way, i.e., that all memory within
an item beyond a certain offset is left undisturbed?  Or is
this just too hacky?

        -- Lennart