[pypy-dev] Not sure what lltype to use in this case

Timothy Baldridge tbaldridge at gmail.com
Fri Mar 9 19:26:19 EST 2018


I have a rather strange use-case for a data type in a rpython interpreter.
What I need is a raw malloc, but with a custom GC hook. I understand how to
setup the GC hook, but what I can't figure out is what lltype to use with
malloc. This type will inherit directly from object so I don't need any
polymorphism. However I do need the struct to be of a variable size. So
something like the C struct hack:

struct MyObject {
   Type* header;
   char data[0];
}

Thanks,

Timothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20180309/2421f9d6/attachment.html>


More information about the pypy-dev mailing list