Skip to content

Commit 7e956e9

Browse files
Added region aware flag to default objects
1 parent a407adb commit 7e956e9

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

Objects/object.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,6 @@ PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value)
11751175
if (tp->tp_setattro != NULL) {
11761176
if (Py_CHECKWRITE(v)) {
11771177
if (!Py_IS_REGION_AWARE(tp)) {
1178-
fprintf(stderr, "XXX: %s\n", tp->tp_name);
11791178
_PyRegion_set_lrc_dirty(v);
11801179
}
11811180
err = (*tp->tp_setattro)(v, name, value);
@@ -1196,7 +1195,6 @@ PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value)
11961195

11971196
if (Py_CHECKWRITE(v)) {
11981197
if (!Py_IS_REGION_AWARE(tp)) {
1199-
fprintf(stderr, "XXX: %s\n", tp->tp_name);
12001198
_PyRegion_set_lrc_dirty(v);
12011199
}
12021200
err = (*tp->tp_setattr)(v, (char *)name_str, value);

Objects/typeobject.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* Type object implementation */
22

33
#include "Python.h"
4+
#include "object.h"
45
#include "pycore_call.h"
56
#include "pycore_code.h" // CO_FAST_FREE
67
#include "pycore_regions.h"
@@ -3334,7 +3335,7 @@ type_new_alloc(type_new_ctx *ctx)
33343335
// All heap types need GC, since we can create a reference cycle by storing
33353336
// an instance on one of its parents.
33363337
type->tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE |
3337-
Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC);
3338+
Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_REGION_AWARE);
33383339

33393340
// Initialize essential fields
33403341
type->tp_as_async = &et->as_async;
@@ -5357,6 +5358,7 @@ PyTypeObject PyType_Type = {
53575358
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
53585359
Py_TPFLAGS_BASETYPE | Py_TPFLAGS_TYPE_SUBCLASS |
53595360
Py_TPFLAGS_HAVE_VECTORCALL |
5361+
Py_TPFLAGS_REGION_AWARE |
53605362
Py_TPFLAGS_ITEMS_AT_END, /* tp_flags */
53615363
type_doc, /* tp_doc */
53625364
(traverseproc)type_traverse, /* tp_traverse */
@@ -6567,7 +6569,8 @@ PyTypeObject PyBaseObject_Type = {
65676569
PyObject_GenericGetAttr, /* tp_getattro */
65686570
PyObject_GenericSetAttr, /* tp_setattro */
65696571
0, /* tp_as_buffer */
6570-
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
6572+
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
6573+
Py_TPFLAGS_REGION_AWARE, /* tp_flags */
65716574
object_doc, /* tp_doc */
65726575
0, /* tp_traverse */
65736576
0, /* tp_clear */

0 commit comments

Comments
 (0)