[syslinux] About the mem management of syslinux.

H. Peter Anvin hpa at zytor.com
Fri Mar 28 10:54:23 PDT 2008


yuziyu wrote:
> Hello. 
> I'm reading the syslinux source code. Could anybody tell me why 
> there are next_free and prev_free in free_arena_header but there are two
> too in the arena_header. It seems they point to the same.
> Thank you!
> 
> struct free_arena_header {
>   struct arena_header a;
>   struct free_arena_header *next_free, *prev_free;
> };
> 

Hello yuziyu,

They do not point to the same thing.  The a.next/a.prev pair (in 
arena_header) form a circularly linked list, with head node, of all the 
memory blocks in the system, *in order by address*.  This includes 
allocated memory blocks.

The next_free/prev_free pair form a circularly linked list, with head 
node, of all the *free* memory blocks in the system, *in any order*. 
This makes allocation quicker, since we don't have to search through 
allocated blocks.

	-hpa




More information about the Syslinux mailing list