[OpenBIOS] Dynamic memory allocation

Programmingkid programmingkidx at gmail.com
Wed Jun 6 14:03:16 CEST 2012

On Jun 4, 2012, at 7:53 PM, openbios-request at openbios.org wrote:

> On 2012-Jun-3 18:48 , Programmingkid wrote:
>> What word can be used in OpenBIOS to dynamically allocate memory? I have tried ALLOCATE, but that word doesn't exist in the dictionary.
> Alloc-mem is the one I'm most likely to use, unless I need dma-able 
> memory, in whch case dma-alloc will be defined by the io nexus.
> There's also always "," to allocate from the heap, depending on how much 
> you need and where.

I couldn't find any documentation on alloc-mem, but I think this is how it works. It pops the top number on the stack and tries to allocate that amount of memory. If it succeeds it returns the address of the memory. If it fails, it returns 0. I think I would release the memory using free-mem. Does this sound about right?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openbios.org/pipermail/openbios/attachments/20120606/a2ac3ae8/attachment.html>

More information about the OpenBIOS mailing list