<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rockbox/firmware/include/buflib.h, branch working</title>
<subtitle>My Rockbox tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/'/>
<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>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>Two more typo fixes</title>
<updated>2014-12-27T01:00:15+00:00</updated>
<author>
<name>Thomas Jarosch</name>
<email>tomj@simonv.com</email>
</author>
<published>2014-12-27T01:00:15+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=d68262eede9c5a5f911f9619784f466a6730e21a'/>
<id>d68262eede9c5a5f911f9619784f466a6730e21a</id>
<content type='text'>
Change-Id: Id3ec7c1da356cb7c617a1d9ad57c9e0ae9fa6611
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Id3ec7c1da356cb7c617a1d9ad57c9e0ae9fa6611
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typos in documentation</title>
<updated>2014-12-27T00:38:11+00:00</updated>
<author>
<name>Thomas Jarosch</name>
<email>tomj@simonv.com</email>
</author>
<published>2014-12-27T00:38:11+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=91f1393f756e61820842f5d63bede89de907de59'/>
<id>91f1393f756e61820842f5d63bede89de907de59</id>
<content type='text'>
Change-Id: I3c7e204bcf67bf0004314fe4b2aec98cae145273
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I3c7e204bcf67bf0004314fe4b2aec98cae145273
</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: 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>
<entry>
<title>buflib: Add buflib_context_relocate().</title>
<updated>2013-12-22T22:11:32+00:00</updated>
<author>
<name>Thomas Martitz</name>
<email>kugel@rockbox.org</email>
</author>
<published>2013-11-21T10:40:04+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=64b9e1fa7b645daa36ca0018dc168d4f871fd538'/>
<id>64b9e1fa7b645daa36ca0018dc168d4f871fd538</id>
<content type='text'>
This function relocates a buflib back buffer, updating pointers in struct
buflib_context. It does not move any data by itself.

The intended use-case is buflib-on-buflib, where a buflib back buffer is
allocated with buflib and attempted to be moved. The move_callback() can call
this and return BUFLIB_CB_OK on success. No move_callback() is called for the
subordinate buflib buffer, therefore it must not contain non-movable
allocations. The caller is generally responsible moving the data and all its
implications.

Change-Id: I869219f9cff786a172c9e917a5f34470073892e6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function relocates a buflib back buffer, updating pointers in struct
buflib_context. It does not move any data by itself.

The intended use-case is buflib-on-buflib, where a buflib back buffer is
allocated with buflib and attempted to be moved. The move_callback() can call
this and return BUFLIB_CB_OK on success. No move_callback() is called for the
subordinate buflib buffer, therefore it must not contain non-movable
allocations. The caller is generally responsible moving the data and all its
implications.

Change-Id: I869219f9cff786a172c9e917a5f34470073892e6
</pre>
</div>
</content>
</entry>
<entry>
<title>buflib: Try harder in buflib_alloc_maximum().</title>
<updated>2013-12-22T22:11:32+00:00</updated>
<author>
<name>Thomas Martitz</name>
<email>kugel@rockbox.org</email>
</author>
<published>2013-05-29T05:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/rockbox/commit/?id=d25a512caf4adf2aac3ce6ac8e1f2c556c0c6c37'/>
<id>d25a512caf4adf2aac3ce6ac8e1f2c556c0c6c37</id>
<content type='text'>
This function will now ask shrinkable allocations to give up all of their
memory. With future support of playback.c this can be used as a safe
replacement for audio_get_buffer().

Change-Id: I290a51d2c75254e66baf5698c41dc444dea6247a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function will now ask shrinkable allocations to give up all of their
memory. With future support of playback.c this can be used as a safe
replacement for audio_get_buffer().

Change-Id: I290a51d2c75254e66baf5698c41dc444dea6247a
</pre>
</div>
</content>
</entry>
</feed>
