<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rockbox/firmware/buflib.c, branch master</title>
<subtitle>My Rockbox tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/'/>
<entry>
<title>buflib: Switch from term "cookie" to "metadata"</title>
<updated>2015-01-02T18:26:03+00:00</updated>
<author>
<name>Thomas Jarosch</name>
<email>tomj@simonv.com</email>
</author>
<published>2015-01-02T18:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=bce72e6f2cab2a71e4a69ccf47b85f2ee1ef3572'/>
<id>bce72e6f2cab2a71e4a69ccf47b85f2ee1ef3572</id>
<content type='text'>
The documentation of buflib first mentions metadata
and then changes to "cookie" without explaining it.

Fix it by sticking to metadata.

Change-Id: I0b36b18f4f2590132901c10326481975f8b9b9da
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The documentation of buflib first mentions metadata
and then changes to "cookie" without explaining it.

Fix it by sticking to metadata.

Change-Id: I0b36b18f4f2590132901c10326481975f8b9b9da
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve core_alloc() / buflib_alloc() documentation</title>
<updated>2015-01-02T17:51:15+00:00</updated>
<author>
<name>Thomas Jarosch</name>
<email>tomj@simonv.com</email>
</author>
<published>2015-01-02T17:41:30+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=66df5f3891779f8d55dd5afba1db466cea2cc2e9'/>
<id>66df5f3891779f8d55dd5afba1db466cea2cc2e9</id>
<content type='text'>
Document the fact that buffers are movable by default.
Care must be taken to not pass them to functions that yield().

Also clarify other things:
- Passing NULL as "ops" to buflib_alloc_ex() causes
  buffers to be movable by default (but not shrinkable).

- If you want shrinkable buffers during compaction,
  you have to provide a shrink callback.

- To disable buffer movement, you have to pass NULL
  for the move_callback inside the callback structure.

- The concept of default callbacks was removed
  long ago, remove the only reference of it.

Change-Id: I3bf0ea6b08b507d80a19f3c2c835aca32b3f7800
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Document the fact that buffers are movable by default.
Care must be taken to not pass them to functions that yield().

Also clarify other things:
- Passing NULL as "ops" to buflib_alloc_ex() causes
  buffers to be movable by default (but not shrinkable).

- If you want shrinkable buffers during compaction,
  you have to provide a shrink callback.

- To disable buffer movement, you have to pass NULL
  for the move_callback inside the callback structure.

- The concept of default callbacks was removed
  long ago, remove the only reference of it.

Change-Id: I3bf0ea6b08b507d80a19f3c2c835aca32b3f7800
</pre>
</div>
</content>
</entry>
<entry>
<title>PictureFlow: Add move callback for buflib allocations</title>
<updated>2015-01-01T22:49:41+00:00</updated>
<author>
<name>Thomas Jarosch</name>
<email>tomj@simonv.com</email>
</author>
<published>2015-01-01T22:45:24+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=9076b433d18b5db1a1987fe99ca7c70808f22b0e'/>
<id>9076b433d18b5db1a1987fe99ca7c70808f22b0e</id>
<content type='text'>
If we don't provide a callback to buflib_alloc(),
the buffer is always movable (to reduce fragmentation).

Since we pass our buffer to functions that call yield(),
this could lead to memory corruption on buflib compaction.

Change-Id: Id1fad1822479d692551c55cb8bc87cea7b78f759
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we don't provide a callback to buflib_alloc(),
the buffer is always movable (to reduce fragmentation).

Since we pass our buffer to functions that call yield(),
this could lead to memory corruption on buflib compaction.

Change-Id: Id1fad1822479d692551c55cb8bc87cea7b78f759
</pre>
</div>
</content>
</entry>
<entry>
<title>Add missing newline in debug output</title>
<updated>2014-12-29T23:17:38+00:00</updated>
<author>
<name>Thomas Jarosch</name>
<email>tomj@simonv.com</email>
</author>
<published>2014-12-29T23:17:38+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=09f7bb82cacc8c63a2b9324e9491d2d06ed92fbd'/>
<id>09f7bb82cacc8c63a2b9324e9491d2d06ed92fbd</id>
<content type='text'>
Change-Id: Ifd67dbcc80db328391464ec93316c48f914bc590
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ifd67dbcc80db328391464ec93316c48f914bc590
</pre>
</div>
</content>
</entry>
<entry>
<title>Document 'union buflib_data'</title>
<updated>2014-12-29T22:49:12+00:00</updated>
<author>
<name>Thomas Jarosch</name>
<email>tomj@simonv.com</email>
</author>
<published>2014-12-29T22:36:50+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=da5a36d6d298de44da687797f7547ab17b58d043'/>
<id>da5a36d6d298de44da687797f7547ab17b58d043</id>
<content type='text'>
Change-Id: Ia98fa8e7887338d6c0b7a5795a0ae5c7a13014ba
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ia98fa8e7887338d6c0b7a5795a0ae5c7a13014ba
</pre>
</div>
</content>
</entry>
<entry>
<title>buflib: Add a define telling the per-alloc overhead.</title>
<updated>2014-02-02T18:40:38+00:00</updated>
<author>
<name>Thomas Martitz</name>
<email>kugel@rockbox.org</email>
</author>
<published>2014-01-28T05:58:09+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=4ce39f7e73b1d1ca4ac5c906d9f9593f46872133'/>
<id>4ce39f7e73b1d1ca4ac5c906d9f9593f46872133</id>
<content type='text'>
This allows buflib clients to more accurately estimate the total memory usage.
It's still not 100% accurate because the handle table grows in blocks, thus
buflib might use more memory that caused by allocations directly.

Change-Id: I68338bb94f510ad188fcb588aebf895b5f9197c5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows buflib clients to more accurately estimate the total memory usage.
It's still not 100% accurate because the handle table grows in blocks, thus
buflib might use more memory that caused by allocations directly.

Change-Id: I68338bb94f510ad188fcb588aebf895b5f9197c5
</pre>
</div>
</content>
</entry>
<entry>
<title>buflib: Properly support allocations without any name, to avoid wasting space</title>
<updated>2014-02-02T18:40:38+00:00</updated>
<author>
<name>Thomas Martitz</name>
<email>kugel@rockbox.org</email>
</author>
<published>2014-02-02T13:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=4ce1deacfd4e5440cc82237ebc5fafbaeea64763'/>
<id>4ce1deacfd4e5440cc82237ebc5fafbaeea64763</id>
<content type='text'>
in micro-allocation scenarios.

Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in micro-allocation scenarios.

Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
</pre>
</div>
</content>
</entry>
<entry>
<title>buflib: Check the validity of of handles passed to buflib_get_data() in DEBUG builds.</title>
<updated>2014-02-02T15:59:29+00:00</updated>
<author>
<name>Thomas Martitz</name>
<email>kugel@rockbox.org</email>
</author>
<published>2014-01-28T14:33:40+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=d66346789ccdf685a6720a739b88f194f56a60e2'/>
<id>d66346789ccdf685a6720a739b88f194f56a60e2</id>
<content type='text'>
Change-Id: Ic274bfb4a8e1a1a10f9a54186b9173dbc0faa4c8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ic274bfb4a8e1a1a10f9a54186b9173dbc0faa4c8
</pre>
</div>
</content>
</entry>
<entry>
<title>buflib: Abstract panicf() into buflib_panic().</title>
<updated>2014-02-02T15:59:29+00:00</updated>
<author>
<name>Thomas Martitz</name>
<email>kugel@rockbox.org</email>
</author>
<published>2014-01-28T14:32:23+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=d608d2203aff93d6d68e7afbac7767cf95c03b8b'/>
<id>d608d2203aff93d6d68e7afbac7767cf95c03b8b</id>
<content type='text'>
Change-Id: I4968a9bc290e10e30a77c36c19f694e286e7ef22
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I4968a9bc290e10e30a77c36c19f694e286e7ef22
</pre>
</div>
</content>
</entry>
<entry>
<title>buflib: Add crc field protecting buflib cookie integrity</title>
<updated>2014-01-16T09:17:39+00:00</updated>
<author>
<name>Marcin Bukat</name>
<email>marcin.bukat@gmail.com</email>
</author>
<published>2014-01-09T20:37:07+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=7ab237b025cbb4c25d345604da32e894379c1721'/>
<id>7ab237b025cbb4c25d345604da32e894379c1721</id>
<content type='text'>
This should catch the case of buffer misuse which results
in corrupted cookie of next allocation. The check is performed
on move_block() so it may be a bit late.

There is buflib_check_valid() provided which checks the
integrity of all cookies for given context.
On DEBUG build with --sdl-thread this check is carried out
for core_ctx on every context switch to catch problems earlier.

Change-Id: I999d4576084592394e3dbd3bdf0f32935ff5f601
Reviewed-on: http://gerrit.rockbox.org/711
Reviewed-by: Thomas Martitz &lt;kugel@rockbox.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should catch the case of buffer misuse which results
in corrupted cookie of next allocation. The check is performed
on move_block() so it may be a bit late.

There is buflib_check_valid() provided which checks the
integrity of all cookies for given context.
On DEBUG build with --sdl-thread this check is carried out
for core_ctx on every context switch to catch problems earlier.

Change-Id: I999d4576084592394e3dbd3bdf0f32935ff5f601
Reviewed-on: http://gerrit.rockbox.org/711
Reviewed-by: Thomas Martitz &lt;kugel@rockbox.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
