Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Rockbox mail archive

Subject: Buffering coming along

Buffering coming along

From: Bryan Jacobs <no_at_landwarsin.asia>
Date: Sun, 5 Jul 2009 13:14:39 -0400

I spent the last week up to my elbows in buffering.c. It's not quite
ready yet, but it's looking good; the patch is at
http://q3q.us/buffer2.patch . Here's what's going on:

- I decided the reservation of independent buffer space was just too
  cruel to live and scratched it.
- The code here instead keeps the list of memory_handles sorted and
  inserts in order; this allows the buffering system to determine when
  it would overwrite the next handle.
- A new memory_handle is no longer necessarily created at the end of
  the buffer - if there's "room" for its whole contents between two
  other handles it is placed there
- The goal is to have a single file consist of a chain of
  memory_handles dynamically created and destroyed as the buffering
  system reads the disk. Because these handles can be inserted in the
  free space between other handles, this will lead to efficient usage
  of the whole buffer's space even while multiple different things are
  being buffered simultaneously.

I've been turning up little gems in the current buffering
implementation like:

copy_mp3entry((struct mp3entry *)h->data, (const struct mp3entry *)src);

For your reference, h->data is a size_t. This code must never have
been run, not even once. The corrected line reads:

copy_mp3entry((struct mp3entry *)(buffer+h->data),
              (const struct mp3entry *)src);

This is probably the most difficult part of the project, so taking
another week on it won't kill me. Still have half the project time
left :-). Slow and steady, eh?

Bryan Jacobs

Received on 2009-07-05

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy