mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
Hacks for MS_COREDLL
This commit is contained in:
parent
3cb486879a
commit
f5030abca8
1 changed files with 19 additions and 0 deletions
|
|
@ -100,11 +100,20 @@ inc_count(tp)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef MS_COREDLL
|
||||||
object *
|
object *
|
||||||
newobject(tp)
|
newobject(tp)
|
||||||
typeobject *tp;
|
typeobject *tp;
|
||||||
|
#else
|
||||||
|
object *
|
||||||
|
newobject(tp,op)
|
||||||
|
typeobject *tp;
|
||||||
|
PyObject *op;
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifndef MS_COREDLL
|
||||||
object *op = (object *) malloc(tp->tp_basicsize);
|
object *op = (object *) malloc(tp->tp_basicsize);
|
||||||
|
#endif
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
return err_nomem();
|
return err_nomem();
|
||||||
op->ob_type = tp;
|
op->ob_type = tp;
|
||||||
|
|
@ -112,13 +121,23 @@ newobject(tp)
|
||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef MS_COREDLL
|
||||||
varobject *
|
varobject *
|
||||||
newvarobject(tp, size)
|
newvarobject(tp, size)
|
||||||
typeobject *tp;
|
typeobject *tp;
|
||||||
int size;
|
int size;
|
||||||
|
#else
|
||||||
|
varobject *
|
||||||
|
newvarobject(tp, size, op)
|
||||||
|
typeobject *tp;
|
||||||
|
int size;
|
||||||
|
varobject *op;
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifndef MS_COREDLL
|
||||||
varobject *op = (varobject *)
|
varobject *op = (varobject *)
|
||||||
malloc(tp->tp_basicsize + size * tp->tp_itemsize);
|
malloc(tp->tp_basicsize + size * tp->tp_itemsize);
|
||||||
|
#endif
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
return (varobject *)err_nomem();
|
return (varobject *)err_nomem();
|
||||||
op->ob_type = tp;
|
op->ob_type = tp;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue