From: B Hodge Newsgroups: comp.os.msdos.djgpp Subject: Re: DMA under djgpp Date: 14 Feb 1998 00:02:43 GMT Organization: University of Alberta Lines: 26 Message-ID: <6c2mv3$vkk$1@pulp.ucs.ualberta.ca> References: <199802130639 DOT WAA14453 AT adit DOT ap DOT net> <6c0u42$b92$1 AT pulp DOT ucs DOT ualberta DOT ca> <6c1n5t$4di$3 AT antares DOT lu DOT erisoft DOT se> NNTP-Posting-Host: gpu2.srv.ualberta.ca To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Martin Stromberg 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/ | \##' +-----------------------------------+