<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 22, 2013 at 11:08 PM, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Ashi,<br>
<br>
after the weekend I think we can further simplify the Freechain interface. The node_size and bump_count are not necessary for the Freechain core routines (_Freechain_Get() and _Freechain_Put()). Thus we should also remove them. In case the extend handler needs more information you can use something like that:<br>
<br>
typedef struct {<br>
Freechain_Control super;<br>
size_t bump_count;<br>
} MyFreechain;<br>
<br>
bool MyFreechainExtend(Freechain_<u></u>Control *super)<br>
{<br>
MyFreechain *self = (MyFreechain *) super;<br>
<br>
...<div><div><br>
}<br>
<br></div></div></blockquote><div>Thanks, Sebastian, it's a cool idea! I've update the code to this idea now.<br>And I also fix a bug in my previous code. In my previous code, the test_node in test case is:<br>typedef struct {<br>
Object_Control obj;<br> int x;<br>}test_node;<br><br>It should be Chain_Node, not Object_Control here. However, because Object_Control's size is bigger than Chain_Node, the test case doesn't crash.<br><br>The github url is: <a href="https://github.com/ashi08104/rtems/tree/add_freelist">https://github.com/ashi08104/rtems/tree/add_freelist</a><br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : +49 89 189 47 41-16<br>
Fax : +49 89 189 47 41-09<br>
E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-<u></u>brains.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
</div></div></blockquote></div><br>Cheers,<br>Zhongwei<br></div></div>