These are chat archives for dropbox/pyston
tp_deallocdon't seem to do much. It's also a bit confusing because from the docs and stack overflow answers, I got the impression that
tp_deallocwas a destructor and
tp_delwas for freeing memory (which usually is always the same logic, hence delegated to the parent). In that sense,
tp_delbut you're right,
__del__if you look at the code.
$HOME/pyston/libunwind); I see no easy way around this
tp_freemixed up, that's why I was confused -_-
tp_dictoffsetis set when we store the attributes in a dict. And the
attrs_offsetwill be set if we store the attributes directly inside the object? Only one of the two can be set at a given time?
tp_basicsizedoesn't include the size of the
dict object*if its exists?
the tp_dictoffset is set when we store the attributes in a dict. And the attrs_offset will be set if we store the attributes directly inside the object? Only one of the two can be set at a given time?
tp_basicsize doesn't include the size of the
dict object*if its exists
tp_basicsize should include those fields.
size = base->tp_basicsize; if (a->tp_dictoffset == size && b->tp_dictoffset == size) size += sizeof(PyObject *); if (a->tp_weaklistoffset == size && b->tp_weaklistoffset == size) size += sizeof(PyObject *);
baseis the base of
tp_dictoffset == size(i.e., we have a dict in
abut not in
base), then increment
same_slots_addedfunction has to look like... Looks like the
sizewon't be the same as
size. But before I make myself even more look like a fool I will better test it and check the source :-D
__bases__and we fail because the layouts are incompatible because one uses
tp_dictoffsetand the other uses
tp_dictoffset? because if the
tp_dictoffsetcan only by set at the base class via capi this should be fine because the base classes have to be the same.
tp_dictoffsetis only for extension modules, but you could imagine someone trying to replace a base from python class -> extension module class
0 <= npart of the if check is missing
if (0 <= n && n < 100)can be turned into
if (n > 99)