kaffe-0.8.x garbage collection problem (at least on m68k)

Esa Salonen es at vat-vai.valmet.com
Mon Mar 3 05:43:35 PST 1997


at least for m68k sizeof (struct _constants) is 10 (not 12),  which means
that in struct _classes (in file classMethod.h) which includes struct _constants
(that used to be a pointer to struct _constants in kaffe-0.5.5)
all pointers after struct _constants (method and field pointers) are
mis aligned when walkObject (in gc-incremental.c) loops through class
objects. That means that some class methods and static fields could be garbage collected,
for example System.out and System.err.

Simple fix is to make struct _constants 12 byte long:


*** kaffe-0.8.1/kaffe/kaffevm/constants.h~	Sun Feb  2 00:30:57 1997
--- kaffe-0.8.1/kaffe/kaffevm/constants.h	Mon Mar  3 14:43:38 1997
***************
*** 78,84 ****
  typedef jword ConstSlot;
  
  typedef struct _constants {
! 	u2		size;
  	u1*		tags;
  	ConstSlot*	data;
  } constants;
--- 78,84 ----
  typedef jword ConstSlot;
  
  typedef struct _constants {
! 	u4		size;
  	u1*		tags;
  	ConstSlot*	data;
  } constants;




More information about the kaffe mailing list