[Gc] Strings representation

Nicolas Cannasse warplayer@free.fr
Tue, 4 Nov 2003 00:14:46 +0900


BTW, I have one question. In a virtual machine I have a string runtime value
that contains some GC values such as a table of methods. What is better
between theses different approachs :

1) alloc a GC block of size  header + string length , fill the header and
the string data will follow (adding maybe type info for preventing the
string data to be scanned)
2) alloc a GC block of fixed size (header + 1) - in words - and put in the
additional field the address of a GC atomic allocated string
3) alloc a GC block of fixed size (header + 1) and put in the additional
field the address of a malloc allocated string with a finalizer calling
free.

Note : strings are immutable here, no realloc call is needed.

Nicolas Cannasse