for (i = 0, p = &list->objects[0];
i < N_FLOATOBJECTS;
i++, p++) {
- if (p->ob_type == &PyFloat_Type && p->ob_refcnt != 0)
+ if (PyFloat_CheckExact(p) && p->ob_refcnt != 0)
frem++;
}
next = list->next;
for (i = 0, p = &list->objects[0];
i < N_FLOATOBJECTS;
i++, p++) {
- if (p->ob_type != &PyFloat_Type ||
+ if (!PyFloat_CheckExact(p) ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
free_list;
for (i = 0, p = &list->objects[0];
i < N_FLOATOBJECTS;
i++, p++) {
- if (p->ob_type == &PyFloat_Type &&
+ if (PyFloat_CheckExact(p) &&
p->ob_refcnt != 0) {
char buf[100];
PyFloat_AsString(buf, p);
static void
int_dealloc(PyIntObject *v)
{
- if (v->ob_type == &PyInt_Type) {
+ if (PyInt_CheckExact(v)) {
v->ob_type = (struct _typeobject *)free_list;
free_list = v;
}
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0)
+ if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
irem++;
}
next = list->next;
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (p->ob_type != &PyInt_Type ||
+ if (!PyInt_CheckExact(p) ||
p->ob_refcnt == 0) {
p->ob_type = (struct _typeobject *)
free_list;
for (i = 0, p = &list->objects[0];
i < N_INTOBJECTS;
i++, p++) {
- if (p->ob_type == &PyInt_Type && p->ob_refcnt != 0)
+ if (PyInt_CheckExact(p) && p->ob_refcnt != 0)
fprintf(stderr,
"# <int at %p, refcnt=%d, val=%ld>\n",
p, p->ob_refcnt, p->ob_ival);