13 byval pool
as TPOOL
ptr, _
14 byval items
as integer, _
15 byval minlen
as integer, _
16 byval maxlen
as integer _
22 pool->chunks = (maxlen + (minlen-1)) \ minlen
23 pool->chunksize = minlen
25 pool->chunktb =
xallocate(
len( TLIST ) * pool->chunks )
27 dim as integer len_ = minlen
28 for i
as integer = 0
to pool->chunks-1
29 listInit( @pool->chunktb[i], items, len_, LIST_FLAGS_LINKFREENODES )
30 len_ += pool->chunksize
36 for i
as integer = 0
to pool->chunks-1
39 deallocate( pool->chunktb )
45 byval pool
as TPOOL
ptr, _
46 byval len_
as integer _
49 dim as TPOOLITEM
ptr item
56 idx = (len_ - 1) \ pool->chunksize
58 if( idx >= pool->chunks )
then
59 item =
xallocate( len_ +
len( TPOOLITEM ) )
66 function =
cast(
byte ptr, item ) +
len( TPOOLITEM )
73 byval pool
as TPOOL
ptr, _
74 byval node
as any ptr _
77 dim as TPOOLITEM
ptr item
79 if( node = NULL )
then
83 item =
cast( TPOOLITEM
ptr,
cast(
byte ptr, node ) -
len( TPOOLITEM ) )
85 if( item->idx >= pool->chunks )
then