<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Free Lists</title>
	<atom:link href="http://ttt.ggnore.net/2007/02/18/free-lists/feed/" rel="self" type="application/rss+xml" />
	<link>http://ttt.ggnore.net/2007/02/18/free-lists/</link>
	<description>Gedanken: gedankenlos gedacht.</description>
	<pubDate>Sat, 04 Sep 2010 19:03:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: purestorm</title>
		<link>http://ttt.ggnore.net/2007/02/18/free-lists/#comment-1345</link>
		<dc:creator>purestorm</dc:creator>
		<pubDate>Sun, 18 Feb 2007 19:12:55 +0000</pubDate>
		<guid isPermaLink="false">http://ttt.ggnore.net/2007/02/18/free-lists/#comment-1345</guid>
		<description>Free lists are a common idiom in data structures themselves (Cormen calls it "aumenting data structures", for example).

The indexes are nothing more than simply pointers with &#038;array as their base address. As far as I know, it could be considered "good C style" to drop pointers in favour of indexes when appropriate. Note, however, that using indexes only works best with data structures of static size - e.g. arrays.

When I want to insert the (MAX_CUSTOMER + 1)th customer then I have to reallocate the array since the indexes will not work correctly with "split" data structures. When I have a linked list of "customer tables" (each having MAX_CUSTOMER entries) then pointers would come in handy. Or I simply use a free list for every table.

An remember, array[index] is nothing more than just writing *(&#038;array + index * sizeof(content_type)).

I do not know a good answer to overcome internal fragmentation. Regular compaction - "defragmentation" - would come at an actually noticeable cost. However, amortizedly analyzed, the cost should disappear.</description>
		<content:encoded><![CDATA[<p>Free lists are a common idiom in data structures themselves (Cormen calls it &#8220;aumenting data structures&#8221;, for example).</p>
<p>The indexes are nothing more than simply pointers with &#038;array as their base address. As far as I know, it could be considered &#8220;good C style&#8221; to drop pointers in favour of indexes when appropriate. Note, however, that using indexes only works best with data structures of static size - e.g. arrays.</p>
<p>When I want to insert the (MAX_CUSTOMER + 1)th customer then I have to reallocate the array since the indexes will not work correctly with &#8220;split&#8221; data structures. When I have a linked list of &#8220;customer tables&#8221; (each having MAX_CUSTOMER entries) then pointers would come in handy. Or I simply use a free list for every table.</p>
<p>An remember, array[index] is nothing more than just writing *(&#038;array + index * sizeof(content_type)).</p>
<p>I do not know a good answer to overcome internal fragmentation. Regular compaction - &#8220;defragmentation&#8221; - would come at an actually noticeable cost. However, amortizedly analyzed, the cost should disappear.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://ttt.ggnore.net/2007/02/18/free-lists/#comment-1344</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Sun, 18 Feb 2007 08:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://ttt.ggnore.net/2007/02/18/free-lists/#comment-1344</guid>
		<description>By the way, do you have a good idea to avoid fragmentation due to the deletion of entries?</description>
		<content:encoded><![CDATA[<p>By the way, do you have a good idea to avoid fragmentation due to the deletion of entries?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://ttt.ggnore.net/2007/02/18/free-lists/#comment-1343</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Sun, 18 Feb 2007 07:58:58 +0000</pubDate>
		<guid isPermaLink="false">http://ttt.ggnore.net/2007/02/18/free-lists/#comment-1343</guid>
		<description>What I like about this approach is the use of an array index as a pointer. By this you can use other data structures for different purposes: e.G. you could us a binary tree for range queries, a hashmap for point queries but still a free list for insertion. You'd just have to adapt  your data structure and algorithms "a bit".

Is this a common C idiom that I passed by because I passed by C?</description>
		<content:encoded><![CDATA[<p>What I like about this approach is the use of an array index as a pointer. By this you can use other data structures for different purposes: e.G. you could us a binary tree for range queries, a hashmap for point queries but still a free list for insertion. You&#8217;d just have to adapt  your data structure and algorithms &#8220;a bit&#8221;.</p>
<p>Is this a common C idiom that I passed by because I passed by C?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
