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

Rockbox mail archive

Subject: Memory management

Memory management

From: <>
Date: Mon Sep 23 08:20:51 2002


In the last few days I've been working on a text file viewer app and I have a few questions concerning memory management :
 - From what I've seen in the code, there is one stack for each thread, and the usual size of this stack is 1kb. Isn't it a bit small ? What happens if we go over this limit ?
 - When we declare a global variable (not in a function), is the memory allocated on the stack or staticaly reserved by the compiler ?
 - The decision was made to not use dynamic memory allocation but it seems to be implemented in the firmware/malloc directory. Should we use malloc or not ?

What I'm trying to do is to load the content of the file in a buffer. I would like this buffer to be pretty large (30kb) but I'm not sure how this should be done: allocated on the stack (we might get an overflow), global variable (memory is not released when we quit the app), dynamic allocation ?


NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap :
Téléphone/Fax : 08 92 69 00 21 (0,34 € TTC/min)
Minitel: 3615 NETCOURRIER (0,15 € TTC/min)
Received on 2002-09-23

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