dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Dynamic memory allocation?

Re: Dynamic memory allocation?

From: Steve Moskovchenko <>
Date: Mon, 02 Jan 2006 21:54:02 -0500


You can sort of write your own malloc (not sure about free?) if you need
it. Check out the source code to MIDI, this uses it for a fact. You
basically get a pointer to the MP3 buffer and start giving out space
from there. This works well if you allocate a bunch of things in the
beginning of your program but do not have any malloc/free cycles within
your loops... then you would run out of space and may have to rethink
how you code that.

On Mon, 2006-01-02 at 21:46 +0100, Tobias Heimann wrote:
> Hi guys,
> I've just started to develop a plugin for rockbox and stumbled over the
> memory allocation:
> Is there anything like malloc() and free() in rockbox and if yes, which
> headers do I have to include for that?
> So far, I've only found buffer_alloc() in buffer.h, but that results in
> an undefined reference error.
> I'm building for the coldfire m68k btw.
> Thanks for any help,
> Tobias

Received on 2006-01-03

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy