Hi, On 8 February 2017 at 11:07, Kunshan Wang <kunshan.wang@anu.edu.au> wrote:
1. Those pointing to GC objects. 2. Those pointing to non-GC objects which can be accessed by native programs (e.g. the byte buffers to be read by the `write` system call when printing) 3. Those pointing to non-GC internal objects within RPython (e.g. vtable)
The problem is: there seems to be not enough static type information to distinguish between case 2 and case 3.
To summarize, the native model of PyPy breaks because you can't reference GC objects from non-GC data, whereas this occurs commonly inside PyPy. But I'm more concerned about function pointers: you say this is GC data too in Mu? How can you then pass a function pointer, pointing to a callback, to external C code? To distinguish between case 2 and case 3, you could simply look inside the Struct at whether it contains references to GC objects or not. This is not perfect but it should work well enough (and can be tweaked manually if necessary in one corner case or two). A bientôt, Armin.