summaryrefslogtreecommitdiff
path: root/firmware/include/dircache.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-06-20 20:12:30 +0000
committerThomas Martitz <kugel@rockbox.org>2011-06-20 20:12:30 +0000
commit52abbb186d62f113eb468754332840d54bd7e756 (patch)
tree51ea81d81391e5b01c1d0cb684b61d22c6741a41 /firmware/include/dircache.h
parentb67f4a1824602d18fbf28b7428bd12186f017f78 (diff)
downloadrockbox-52abbb186d62f113eb468754332840d54bd7e756.tar.gz
rockbox-52abbb186d62f113eb468754332840d54bd7e756.zip
Dircache: Change internal cache layout.
The dircache_entry structs are now allocated subsequently from the front, allowing to treat them as an array. The d_names are allocated from the back (in reverse order, growing downwards). This allows the cache to be moved around (needed for my buflib gsoc project). It is utilized when loading the cache from disk (on the h100), now the pointer to the cache begin doesn't need to be the same across reboots anymore. This should save a bit memory usage, since there's no need for aligning padding bytes after d_names anymore. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30036 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/include/dircache.h')
-rw-r--r--firmware/include/dircache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h
index 716d1fbed2..d04c176996 100644
--- a/firmware/include/dircache.h
+++ b/firmware/include/dircache.h
@@ -47,13 +47,14 @@ struct travel_data {
47 int pathpos; 47 int pathpos;
48}; 48};
49 49
50#define DIRCACHE_MAGIC 0x00d0c0a0 50#define DIRCACHE_MAGIC 0x00d0c0a1
51struct dircache_maindata { 51struct dircache_maindata {
52 long magic; 52 long magic;
53 long size; 53 long size;
54 long entry_count; 54 long entry_count;
55 long appflags; 55 long appflags;
56 struct dircache_entry *root_entry; 56 struct dircache_entry *root_entry;
57 char *d_names_start;
57}; 58};
58 59
59#define MAX_PENDING_BINDINGS 2 60#define MAX_PENDING_BINDINGS 2