Lines Matching refs:to

9 configured to the needs of an application.  BGET is  efficient  in  both
10 the time needed to allocate and release buffers and in the memory
12 consolidates contiguous space to minimise fragmentation. BGET is
15 * A built-in test program to exercise BGET and
21 * Wiping buffers at release time to catch code which
24 * Built-in routines to dump individual buffers or the
29 * Quantisation of buffer sizes to a power of two to
33 means of call-backs to user defined functions.
36 embedded programs to providing the framework upon which a multitasking
47 to name two, on which programs have obtained substantial speed-ups by
56 fast, memory efficient, portable, and easy to integrate into your
67 this generally means that BGET should be used to allocate storage within
84 references which are made in the interest of providing a roadmap to
85 guide you to the BGET functions you're likely to need.
90 Embedded applications typically have a fixed area of memory dedicated to
106 bpool()--usually obtained by making a call to the operating system's
109 to zero and [inefficient] re-allocation of existing buffers for
112 the underlying operating system, add it to the buffer pool by another
113 call to bpool(), and continue execution.
124 doesn't make much sense to provide a release function without an
126 defined with bectl(), you simply use bget() and brel() to allocate and
128 bpool() or rely on automatic allocation to acquire the entire pool.
131 space required to satisfy the allocation request and a sequence number
132 to allow the compaction routine to be called successively without
133 looping). If the compaction function is able to free any storage (it
139 If the compaction function returns zero, indicating failure to free
141 non-NULL allocation function was supplied to bectl(). If so, that
144 increment supplied in the call to bectl() unless the original bget()
148 a pointer to the new block and BGET expands the buffer pool; if it
149 fails, the allocation request fails and returns NULL to the caller. If
151 totally empty are released to the global free pool by passing their
152 addresses to the release function.
171 <buffer>. You can call bpool() subsequently to contribute additional
172 storage to the overall buffer pool.
177 returned, or NULL if insufficient memory was available to allocate the
182 Allocate a buffer of <size> bytes and clear it to all zeroes. The
184 available to allocate the buffer.
188 Reallocate a buffer previously allocated by bget(), changing its size to
190 insufficient memory is available to reallocate the buffer, in which case
195 Return the buffer <buf>, previously allocated by bget(), to the free
210 overhead) required to satisfy the allocation request, and a sequence
212 attempting to satisfy this allocation request. The sequence number is 1
214 increments on subsequent calls, permitting the <compact> function to
215 take increasingly dire measures in an attempt to free up storage. If
217 is re-tried. If <compact> returns 0 (as it must if it isn't able to
218 release any space or add storage to the buffer pool), the allocation
221 called, the state of the buffer allocator is identical to that at the
226 the need to ensure that whatever actions it takes do not change things
229 being reallocated with bgetr() would lead to disaster. Implementing a
236 allocating the requested space and returns a pointer to the new area,
241 subsequent bget() requests for buffers too large to be managed in the
243 buffer overhead) to be satisfied directly by calls to the <acquire>
251 pointed to by <curalloc>. The total free space (sum of all free blocks
252 in the pool) is stored into the variable pointed to by <totfree>, and
254 into the variable pointed to by <maxfree>. The variables pointed to by
264 variable pointed to by <pool_incr>, or the negative thereof if automatic
266 pool blocks will be stored into the variable pointed to by <npool>. The
267 variables pointed to by <npget> and <nprel> will be filled with,
269 which have occurred. The variables pointed to by <ndget> and <ndrel>
276 The buffer pointed to by <buf> is dumped on standard output.
305 #define BufDump 1 /* Define this symbol to enable the
309 #define BufValid 1 /* Define this symbol to enable the
313 #define DumpData 1 /* Define this symbol to enable the
318 #define BufStats 1 /* Define this symbol to enable the
325 #define FreeWipe 1 /* Wipe free buffers to a guaranteed
326 pattern of garbage to trip up
327 miscreants who attempt to use
336 #define BECtl 1 /* Define this symbol to enable the