RLIST(9) 386BSD Kernel Programmer's Manual RLIST(9)
NAME
rlist - resource list
SYNOPSIS
#include "rlist.h"
void
rlistfree(struct rlist **rlp, unsigned start, unsigned end)
int
rlistalloc(struct rlist **rlp, unsigned size, unsigned *loc)
void
rlistdestroy(struct rlist **rlp)
DESCRIPTION
Resource lists are a sparse data abstraction used to record the use of
real and abstract resources employed by the kernel program. Resource
lists rely on dynamic memory (see malloc(9) ) to avoid compile-time
scaling of space to hold fragmentation. Since resources may need to be
allocated during interrupt level, or during times when memory can't be
allocated (like when reclaiming memory pages), resource lists must be
allocated without blocking (however, they may block on the free of
resource).
Each resource list is denoted by a head pointer, which initially points
to a null list, and filled with resource by "freeing" space into it that
can be allocated subsequently. If the resource list itself must be
reclaimed, it must be destroyed by the service employing the resource.
The rlistalloc() function allocates a segment of resource of a requested
size if available. The rlistfree() function assigns resource for use in
the list, possibly blocking. The rlistdestroy() function is used to
reclaim the storage used in implementing the resource list itself.
RETURN VALUES
The rlistalloc() function returns a success or failure indication on
return.
SEE ALSO
malloc(9)
386BSD Release 1.0 August 29, 1994 1