Looking at rbuffer, rgc, and the lltype namespaces, it's not completely
clear to me how I would go about writing a struct with a resizable
primitive array inlined.

Something like:

typedef struct foo_t {
int a, b;
int _data[0];
}

foo_t tmp = malloc(sizeof(foo_t) + 64);

I can see that the GC has the ability to allocate "extra" memory beyond
what's required for a struct, and that lltype has the ability to inline
some lists into a struct, but how does this work in practice? And maybe I'm
missing something in the docs, so simply pointing me to some docs is also
fine.


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to