Re: Dynamic memory allocation?

2006-01-02 Thread Steve Moskovchenko
Hello. 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

Re: Dynamic memory allocation?

2006-01-02 Thread Tomas
Hi, There is a plugin buffer in which you can allocate the memory you need. I needed some form of malloc() once, in /apps/plugins/dict.c (see here: http://www.rockbox.org/viewcvs.cgi/apps/plugins/dict.c?rev=1.7&view=markup ). So I wrote a very simple function called pl_malloc() there... may

Re: Dynamic memory allocation?

2006-01-02 Thread Bluechip
As someone once said to me, if you want malloc/free/etc code them. After about 10 minutes of thinking on the problem I realised just how much of my 32K of memory such algorithms would cost me and decided to write my code with static memory allocations set at compile time. Tobias, if you need

Re: Dynamic memory allocation?

2006-01-02 Thread George Styles
The (much argued over) view of the rockbox dev'ers is that dynamic memory allocation is a bad idea in embedded systems, like Rockbox. The reason usually given is that you have to deal with the 'worst case' scenario anyway (ie, all resources are needed), therefore you need at least this much ram av

Dynamic memory allocation?

2006-01-02 Thread Tobias Heimann
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 undefi