8000 gh-117142: ctypes: Fix memory leak of StgInfo by neonene · Pull Request #118139 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-117142: ctypes: Fix memory leak of StgInfo #118139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
fix typeslots.py
  • Loading branch information
neonene committed Apr 22, 2024
commit 42a8aa74ef62cb87e839f6ab33d91efeceea59e5
1 change: 0 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -4630,7 +4630,6 @@ _PyType_FromMetaclass_impl(
/* Copy other slots directly */
PySlot_Offset slotoffsets = pyslot_offsets[slot->slot];
short slot_offset = slotoffsets.slot_offset;
assert(slot_offset != Py_id_static_spec);
if (slotoffsets.subslot_offset == -1) {
/* Set a slot in the main PyTypeObject */
*(void**)((char*)res_start + slot_offset) = slot->pfunc;
Expand Down
2 changes: 1 addition & 1 deletion Objects/typeslots.inc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Objects/typeslots.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def generate_typeslots(out=sys.stdout):
member = (f'{{offsetof(PyBufferProcs, {member}),'+
' offsetof(PyTypeObject, tp_as_buffer)}')
elif member == "id_static_spec":
member = '{-1, Py_id_static_spec}'
member = '{-1, offsetof(PyHeapTypeObject, ht_static_spec)}'
res[int(m.group(2))] = member

M = max(res.keys())+1
Expand Down
Loading
0