Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#9506 - buffer_alloc the dircache stack

Attached to Project: Rockbox
Opened by Jonathan Gordon (jdgordon) - Monday, 27 October 2008, 17:03 GMT+2
Last edited by amaury pouly (pamaury) - Friday, 19 February 2010, 00:16 GMT+2
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

seen as there is no point having the dircache thread if its disabled, and because it cant be enabled without rebooting, there is no need having the stack statically allocated...

untested on target...
   dircache_alloc.diff (2.1 KiB)
 apps/main.c                 |    4 ++--
 firmware/include/dircache.h |    2 +-
 firmware/common/dircache.c  |    9 ++++++---
 3 files changed, 9 insertions(+), 6 deletions(-)

This task depends upon

Closed by  amaury pouly (pamaury)
Friday, 19 February 2010, 00:16 GMT+2
Reason for closing:  Rejected
Additional comments about closing:  Recents commits r24657 and r24708 already saved quite some space and reduced the size of the dircache thread stack.
Comment by Jonathan Gordon (jdgordon) - Tuesday, 28 October 2008, 14:51 GMT+2
new version removes one set of buffer_alloc()'s which is required even if dircache is disabled.
   dircache_alloc.diff (2.6 KiB)
 apps/main.c                 |    4 ++--
 firmware/include/dircache.h |    2 +-
 firmware/common/dircache.c  |   15 +++++++++++----
 3 files changed, 14 insertions(+), 7 deletions(-)

Comment by Jonathan Gordon (jdgordon) - Tuesday, 28 October 2008, 15:12 GMT+2
OK, So I'm pretty sure I'm only looking at this because i should be studying for exams so I dont really know what to do about this patch...
if its about freeing up more RAM when its disabled then there is another 30KB buffer (dir_recursion, line 157) which could be buffer_alloc()-ed which is a hell of a lot more than the ~800 bytes + 1 thread saved by the patch in the previous comment...
but if the plan is to (hopefully) make buffer_alloc() be able to tell everything that called it to dump the ram and realloc it later, then I dont know if changing that buffer is helpful in the long run... will freeing up 31K do anything more than give a nice ram delta?
Comment by Rafaël Carré (funman) - Monday, 03 November 2008, 06:42 GMT+2
+#define DIRCACHE_STACK_SIZE (DEFAULT_STACK_SIZE + 0x900)/sizeof(long)

you should remove /sizeof(long) if buffer_alloc() takes an argument in bytes
Comment by Jonathan Gordon (jdgordon) - Monday, 03 November 2008, 08:48 GMT+2
ah yes, thanks, will do that if we decide to commit this

Loading...