Mail Archives: djgpp/1998/02/13/19:17:22
Martin Stromberg <Martin DOT Stromberg AT lu DOT erisoft DOT se> wrote:
> [ Klippa, klapp, kluppit excellent method to allocate DMA buffer. ]
I try. :)
I started using a stack implementation, but then I started using a
recursive implementation instead. Recursion simplified everything as the
buffer's pointer is stored on the program's stack, so the function doesn't
require a stack of pointers to keep track of everything. Since you only
allocated the DMA buffer once at startup and not in any loops, recursion
works great, speed ain't an issue.
Alloc. If it failed, can't be done. If it is good, use it. Otherwise
try again then free the bad buffer. Simple really, and no wasted memory.
:)
Blaine Hodge
_ ___
#_~`--'__ `===-, +-----------------------------------+
`.`. `#.,// | Blaine Hodge +
,_\_\ ## #\ | bhodge AT gpu DOT srv DOT ualberta DOT ca |
`__.__ `####\ | blaine AT cs DOT ualberta DOT ca |
~~\ ,###'~ | http://www.ualberta.ca/~bhodge/ |
\##' +-----------------------------------+
- Raw text -