6.2.4.2.17. sizeof

Comienzo python section to interscript/core/mxTools.py[18 /26 ] Siguiente Previo Primero Último
   130: #line 1582 "mxTools.pak"
   131: def sizeof(condition,sequence):
   132:   raise 'We cannot get the sizeof an object in Python'
   133: 
End python section to interscript/core/mxTools.py[18]
Comienzo C section to interscript/core/mxTools.c[19 /30 ] Siguiente Previo Primero Último
  1360: #line 1586 "mxTools.pak"
  1361: 
  1362: Py_C_Function( mxTools_sizeof,
  1363:                "sizeof(object)\n\n"
  1364:                "Returns the size in memory of the object in bytes.\n"
  1365:                "Note that this doesn't show any extra space allocated by\n"
  1366:                "the object.")
  1367: {
  1368:     int size;
  1369:     register PyObject *w;
  1370:     PyTypeObject *t;
  1371: 
  1372:     Py_GetArgObject(w);
  1373:     t = w->ob_type;
  1374:     size = t->tp_basicsize;
  1375:     if (t->tp_itemsize)
  1376:         size += t->tp_itemsize * ((PyVarObject *)w)->ob_size;
  1377: 
  1378:     return PyInt_FromLong((long)size);
  1379:  onError:
  1380:     return NULL;
  1381: }
  1382: 
End C section to interscript/core/mxTools.c[19]