Commit 2b9fd97b authored by Kevin Modzelewski's avatar Kevin Modzelewski

Don't allocate an extra tuple element

For some reason CPython allocates an extra "item" for generic
variable-sized objects, but it looks like it doesn't do that for
tuples.  We had been doing that, so let's try not doing that
and saving 8 bytes per tuple.
parent d50f760f
......@@ -613,7 +613,7 @@ public:
assert(tuple_cls->is_pyston_class);
assert(tuple_cls->attrs_offset == 0);
void* mem = gc_alloc(sizeof(BoxedTuple) + nitems * sizeof(Box*), gc::GCKind::PYTHON);
void* mem = gc_alloc(offsetof(BoxedTuple, elts) + nitems * sizeof(Box*), gc::GCKind::PYTHON);
assert(mem);
BoxVar* rtn = static_cast<BoxVar*>(mem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment