There is described a method of accurately scanning the C stack. One technique
for solving these problems is to indirectly reference objects using handles however
the some JVMs have removed handles to gain a performance improvement. The embodiment
describes a solution in which 32 bit quantities are known to be object references
by means of some side information. This avoids the problem of integer values masquerading
as references causing objects to be needlessly retained. It also allows employment
of a compacting collector which is allowed to move objects even if they are referenced
from the stacks. Currently the compactor is prevented from moving such objects
leading to reduced compaction efficiency.