From eb0137fcb516f9b95d0f359fe1327ac7484abc0c Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sun, 10 Aug 2008 12:46:15 +0000 Subject: [PATCH] "waste" a bit more RAM on targets with more than 8MB so more directories can be opened at the same time (most obvious when you have really deep directory trees) closes FS#6410, FS#6512, FS#6514 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18234 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/dir_uncached.c | 4 ++++ firmware/common/dircache.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/firmware/common/dir_uncached.c b/firmware/common/dir_uncached.c index e036c95840..1de81bd79e 100644 --- a/firmware/common/dir_uncached.c +++ b/firmware/common/dir_uncached.c @@ -27,7 +27,11 @@ #include "dir.h" #include "debug.h" +#if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) +#define MAX_OPEN_DIRS 16 +#else #define MAX_OPEN_DIRS 8 +#endif static DIR_UNCACHED opendirs[MAX_OPEN_DIRS]; diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 313102b9a1..4eb97ce3da 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -49,7 +49,11 @@ #define DIRCACHE_BUILD 1 #define DIRCACHE_STOP 2 +#if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) +#define MAX_OPEN_DIRS 16 +#else #define MAX_OPEN_DIRS 8 +#endif static DIR_CACHED opendirs[MAX_OPEN_DIRS]; static struct dircache_entry *fd_bindings[MAX_OPEN_FILES];