Kaffe Memory Management

Johan Andersson kaffe@rufus.w3.org
Wed, 7 Jun 2000 17:22:01 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_00E2_01BFD0A4.E4857A30
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi.


Why does Kaffe (linux) uses sbrk(..) to allocate memory. According to =
the man. pages for sbrk(..) it is not very feasible. Why doesn't Kaffe =
use malloc(..)?

In gc_small_alloc(..) and gc_large_alloc(..):

info->funcs=3D(unitp8*)GCBLOCK2BASE(info);
info->state=3D(unitp8*)(info->funcs+nr);
info->data=3D....;
.
What happens here? Where do these pointers point to. Memory addresses in =
the heap or to addresses in the space allocated by malloc for a number =
of gc_blocks (which is used by the gc_primary_freelist).

The bottom line is, what of the gc_block is put on the heap?


/johan



------=_NextPart_000_00E2_01BFD0A4.E4857A30
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Why does Kaffe (linux) uses sbrk(..) to =
allocate=20
memory. According to the man. pages for sbrk(..) it is not very =
feasible. Why=20
doesn't Kaffe use malloc(..)?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In gc_small_alloc(..) and=20
gc_large_alloc(..):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>info-&gt;funcs=3D(unitp8*)GCBLOCK2BASE(info);</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>info-&gt;state=3D(unitp8*)(info-&gt;funcs+nr);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>info-&gt;data=3D....;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What happens here? Where do these =
pointers point=20
to. Memory addresses in the heap or to addresses in the space allocated =
by=20
malloc for a number of gc_blocks (which is used by the=20
gc_primary_freelist).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The bottom line is, what of the =
gc_block is put on=20
the heap?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>/johan</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_00E2_01BFD0A4.E4857A30--