Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Operating System/Drivers
  • Assigned To
    Thomas Martitz
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Release 3.8.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Thomas Martitz - 2011-05-28
Last edited by Thomas Martitz - 2011-06-21

FS#12133 - Dircache patches

I put up a few dircache related patches for review/discussion.

0001-Dircache-Remove-dircache_entry-name_len.patch:
- This removes the name_len memeber from struct dircache_entry. This saves 4 bytes per file in the cache which is easily a couple of KB. The name_len was intended as a means to save strlen() calls but that was not really useful as the shortcut was hardly used. The patch also replaces memcpy with strcpy calls to ensure nul-termination (needed to make strlen() work).

0002-Dircache-Rework-and-simplify-dircache_copy_path.patch:
- The only place where name_len was useful was dircache_copy_path(), for the final string length calculation. This patch rewrites the function to use recursion so that the length calculation isn’t needed and it doesn’t need to go through the linked list twice anymore.

0003-Dircache-Return-the-size-of-the-result-string-in-dir.patch:
- Extends the above dircache_copy_path() to return the string length so that callers don’t need it anymore.

0004-Fix-dircache_size-calculation-bug-introcuced-3-revis.patch:
- just fixes a bug introduced by the 1st patch (separate patch to not mess with my local git history).

0005-Dircache-Change-internal-cache-layout.patch:
- This changes the layout of the dircache. struct dircache_entrys are allocated from the beginning, the d_name strings from the back. This allows the buffer to be moveable/relocatable which is beneficial for h100 users (as the dircache_root pointer doesn’t need to be the same across reboots anymore) and ultimatively needed for my gsoc buflib project.

Closed by  Thomas Martitz
2011-06-21 07:41
Reason for closing:  Accepted
Additional comments about closing:  

r30032 onwards

Thomas Martitz commented on 2011-05-29 01:27

I add 2 more patches.

0006-Dircache-Move-struct-maindata-declaration-to-dircach.patch:
- dircache_load() didn't actually very the DIRCACHE_MAGIC found in the cache dump. Fix that.

0007-Dircache-Don-t-expose-struct-dircache_entry-and-poin.patch:
- This patch removes the exposure of pointers into dircache memories to other modules. Only integer IDs are passed around. This enables moving the struct dircache_entry declaration into dircache.c. I will need to isolate the dircache buffer for my buflib gsoc project.

Thomas Martitz commented on 2011-06-05 11:03

This opimizes dircache_copy_path a bit, so that the string buffer is not walked repeatedly by strlcat.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing