Thanks, I'll check it out. On Tue, Oct 30, 2018 at 1:58 AM Armin Rigo <armin.r...@gmail.com> wrote:
> Hi Timothy, > > On Tue, 30 Oct 2018 at 00:42, Timothy Baldridge <tbaldri...@gmail.com> > wrote: > > typedef struct foo_t { > > int a, b; > > int _data[0]; > > } > > > > foo_t tmp = malloc(sizeof(foo_t) + 64); > > You can do that if you use the lltype.GcStruct type directly, not > using "regular" RPython code. See the main example in > rpython.rtyper.lltypesystem.rstr: the types STR and UNICODE. They are > defined as lltype.GcStruct('name', ..some_regular_fields.., > inlined_array_field), and allocated with lltype.malloc(STR, > length_of_array). > > Note that you also need to prevent the JIT from seeing any such type: > it has got special case for STR and UNICODE but doesn't handle the > general case. > > > A bientôt, > > Armin. > -- “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