Date: Mon, 22 Nov 2004 23:01:54 +0100 From: Hans Van den Eynden <hans.vandeneynden@student.kuleuven.ac.be> To: freebsd-questions@freebsd.org Subject: pginfo problem Message-ID: <41A261D2.2070004@student.kuleuven.ac.be>
next in thread | raw e-mail | index | archive | help
In ifree there is
index = ptr2index(ptr); //the index in the page_dir is calculated
info = page_dir[index]; //the FIRST pginfo structure in the list for that specific chunksize
free_bytes(ptr, index, info);
in free_bytes there is
/* Find the chunk number on the page */
i = ((u_long)ptr & malloc_pagemask) >> info->shift;
info->bits[i/MALLOC_BITS] |= 1<<(i%MALLOC_BITS); //ALWAYS the FIRST pginfo structure is updated
info->free++; //ALWAYS the FIRST pginfo structure is updated
I thought that page_dir was something like this:
page_dir-- first 4 not used
-- first pg_info for size 1
-- first pg_info for size 2
-- first pg_info for size 3 -- second pg_info for size 1 -- third pg_info for size
-- first pg_info for size 4
-- first pg_info for size 5
-- first pg_info for size 6 -- second pg_info for size 6
-- ...
--MALLOC_FIRST
--MALLOC_FREE
--...
But in the algorithm always the first pginfo structure is chosen??
What is wrong with in thinking??
thx
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41A261D2.2070004>
