diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-02 17:39:34 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-02 17:39:34 +0000 |
| commit | d8ac6074184ffc21c4da8c594df72ee42aa23df2 (patch) | |
| tree | c42203d8bf2c7e85a9886616f0268250dbe5e9d6 /firmware/common | |
| parent | d68ae6a7a62e0a32cfc84200092985910c0fd099 (diff) | |
| download | rockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.zip rockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.tar.gz rockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.tar.bz2 rockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.tar.xz | |
Tagcache: Fixed runtime stats not being gathered when tagcache is kept
on disk. Initial attempt to make tagcache thread safe. Replaced a few
direct buffer allocations with buffer_alloc from tagcache and dircache
where possible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10415 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common')
| -rw-r--r-- | firmware/common/dircache.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 7599c1b..6167aa3 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -623,14 +623,10 @@ int dircache_build(int last_size) return 2; } - dircache_root = (struct dircache_entry *)(((long)audiobuf & ~0x03) + 0x04); - if (last_size > DIRCACHE_RESERVE && last_size < DIRCACHE_LIMIT ) { allocated_size = last_size + DIRCACHE_RESERVE; - - /* We have to long align the audiobuf to keep the buffer access fast. */ - audiobuf += (long)((allocated_size & ~0x03) + 0x04); + dircache_root = (struct dircache_entry *)buffer_alloc(allocated_size); thread_enabled = true; /* Start a transparent rebuild. */ @@ -638,6 +634,8 @@ int dircache_build(int last_size) return 3; } + dircache_root = (struct dircache_entry *)(((long)audiobuf & ~0x03) + 0x04); + /* Start a non-transparent rebuild. */ return dircache_do_rebuild(); } @@ -672,8 +670,7 @@ void dircache_init(void) memset(opendirs, 0, sizeof(opendirs)); for (i = 0; i < MAX_OPEN_DIRS; i++) { - opendirs[i].secondary_entry.d_name = audiobuf; - audiobuf += MAX_PATH; + opendirs[i].secondary_entry.d_name = buffer_alloc(MAX_PATH); } queue_init(&dircache_queue); |