[Fwd: Re: Keeping oops across primitives]

Tony Garnock-Jones tonyg at lshift.net
Fri Jun 9 09:01:32 UTC 2006


Andreas Raab wrote:
> Actually, this is an interesting thought. I have the need for managing a
> dynamic array of roots but this could be handled just as easily by
> tracking a variable pointing to a Squeak array.

A variable in C is more-or-less a one-place array, so perhaps supporting
arrays is the simpler option?

{
  sqInt myRoot = ...;
  vm->addToVmRoots(&myRoot, 1, NULL);
  ...
  vm->addToVmRoots(NULL, 0, &myRoot);
}



#define WITH_ROOT(vm, var, blk) \
  { (vm)->addToVmRoots(&(var), 1, NULL); \
    blk; \
    (vm)->addToVmRoots(NULL, 0, &(var)); }

{
  sqInt myRoot2 = ...;
  WITH_ROOT(vm, myRoot2, {
    ...
  });
}




More information about the Vm-dev mailing list