mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-22 00:04:58 +00:00
Remove long untrue note about storing state information inside free items.
OKed by: rwatson, tegge Approved by: pjd (mentor) MFC after: 1 week
This commit is contained in:
parent
45ea8737bf
commit
7251f55777
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162946
|
@ -65,27 +65,9 @@ The zone allocator keeps track of which items are in use and which
|
|||
are not, and provides functions for allocating items from the zone and
|
||||
for releasing them back (which makes them available for later use).
|
||||
.Pp
|
||||
The zone allocator stores state information inside the items proper
|
||||
while they are not allocated,
|
||||
so structures that will be managed by the zone allocator
|
||||
and wish to use the type stable property of zones by leaving some fields
|
||||
pre-filled between allocations, must reserve
|
||||
two pointers at the very beginning for internal use by the zone
|
||||
allocator, as follows:
|
||||
.Bd -literal -offset indent
|
||||
struct my_item {
|
||||
struct my_item *z_rsvd1;
|
||||
struct my_item *z_rsvd2;
|
||||
/* rest of structure */
|
||||
};
|
||||
.Ed
|
||||
.Pp
|
||||
Alternatively they should assume those entries corrupted
|
||||
after each allocation.
|
||||
After the first allocation of an item,
|
||||
it will have been cleared to zeroes, however subsequent allocations
|
||||
will retain the contents as of the last free, with the exception of the
|
||||
fields mentioned above.
|
||||
will retain the contents as of the last free.
|
||||
.Pp
|
||||
The
|
||||
.Fn uma_zcreate
|
||||
|
|
Loading…
Reference in a new issue