Lines Matching full:a
6 A :dfn:`memory slab` is a kernel object that allows memory blocks
7 to be dynamically allocated from a designated memory region.
8 All memory blocks in a memory slab have a single fixed size,
22 A memory slab has the following key properties:
30 * A **buffer** that provides the memory for the memory slab's blocks.
34 N is a power of 2 larger than 2 (i.e. 4, 8, 16, ...). To ensure that
36 the block size must also be a multiple of N.
38 A memory slab must be initialized before it can be used. This marks all of
41 A thread that needs to use a memory block simply allocates it from a memory
42 slab. When the thread finishes with a memory block,
45 If all the blocks are currently in use, a thread can optionally wait
48 when a memory block becomes available, it is given to the highest-priority
51 Unlike a heap, more than one memory slab can be defined, if needed. This
52 allows for a memory slab with smaller blocks and others with larger-sized
53 blocks. Alternatively, a memory pool object may be used.
58 A memory slab's buffer is an array of fixed-size blocks,
61 The memory slab keeps track of unallocated blocks using a linked list;
67 Defining a Memory Slab
70 A memory slab is defined using a variable of type :c:type:`k_mem_slab`.
73 The following code defines and initializes a memory slab that has 6 blocks
74 that are 400 bytes long, each of which is aligned to a 4-byte boundary.
83 Alternatively, a memory slab can be defined and initialized at compile time
93 Similarly, you can define a memory slab in private scope:
99 Allocating a Memory Block
102 A memory block is allocated by calling :c:func:`k_mem_slab_alloc`.
105 for a memory block to become available, then fills it with zeroes.
106 A warning is printed if a suitable block is not obtained.
119 Releasing a Memory Block
122 A memory block is released by calling :c:func:`k_mem_slab_free`.
124 The following code builds on the example above, and allocates a memory block,
138 Use a memory slab to allocate and free memory in fixed-size blocks.