The only simple and reliable way is to store the pointer in a malloc'ed or NO_SCAN'ed memory area.
Actually, scratch that. Any 4 byte pattern can look like a pointer.
Unless you manage to encode it in a way the 4 byte cells look like
they're pointing into an address range not managed by the GC. For
example, most OSes reserve the last 1 or 2 GBs for the kernel. If your
byte quadruple looks like a pointer into the kernel, it's always safe
not to be scanned.
- Keeping a list of instances and garbage-collection Simon TRENY
- Re: Keeping a list of instances and garbage-colle... Leandro Lucarella
- Re: Keeping a list of instances and garbage-c... Jarrett Billingsley
- Re: Keeping a list of instances and garbage-c... grauzone
- Re: Keeping a list of instances and garba... Christopher Wright
- Re: Keeping a list of instances and g... grauzone
- Re: Keeping a list of instances ... Christopher Wright
- Re: Keeping a list of instan... Bill Baxter
- Re: Keeping a list of instan... grauzone
- Re: Keeping a list of in... grauzone
- Re: Keeping a list of instances and garba... Bill Baxter
- Re: Keeping a list of instances and garba... bearophile
- Re: Keeping a list of instances and g... Bill Baxter
- Re: Keeping a list of instances and garbage-colle... Chad J
- Re: Keeping a list of instances and garbage-c... Sergey Gromov
- Re: Keeping a list of instances and garba... Sean Kelly
- Re: Keeping a list of instances and g... grauzone
- Re: Keeping a list of instances ... Sean Kelly