If you pick this up you need to re interigate every thing you have

This commit is contained in:
Roger Hughston 2007-05-12 01:16:04 +00:00
parent 3c903dbd77
commit ad4aa44a6b
2 changed files with 22 additions and 4 deletions

View File

@ -23,9 +23,9 @@
PyMemberDef standard_type_members[] = { PyMemberDef standard_type_members[] = {
{"this", T_INT, offsetof(Dtool_PyInstDef,_ptr_to_object),READONLY,"C++ This if any"}, {"this", T_INT, offsetof(Dtool_PyInstDef,_ptr_to_object),READONLY,"C++ This if any"},
{"this_ownership", T_INT, offsetof(Dtool_PyInstDef, _memory_rules), READONLY,"C++ 'this' ownership rules"}, // {"this_ownership", T_INT, offsetof(Dtool_PyInstDef, _memory_rules), READONLY,"C++ 'this' ownership rules"},
{"this_const", T_INT, offsetof(Dtool_PyInstDef, _is_const), READONLY,"C++ 'this' const flag"}, // {"this_const", T_INT, offsetof(Dtool_PyInstDef, _is_const), READONLY,"C++ 'this' const flag"},
{"this_signature", T_INT, offsetof(Dtool_PyInstDef, _signature), READONLY,"A type check signature"}, // {"this_signature", T_INT, offsetof(Dtool_PyInstDef, _signature), READONLY,"A type check signature"},
{"this_metatype", T_OBJECT, offsetof(Dtool_PyInstDef, _My_Type), READONLY,"The dtool meta object"}, {"this_metatype", T_OBJECT, offsetof(Dtool_PyInstDef, _My_Type), READONLY,"The dtool meta object"},
{NULL} /* Sentinel */ {NULL} /* Sentinel */
}; };

View File

@ -61,6 +61,8 @@
using namespace std; using namespace std;
#define PY_PANDA_SMALLER_FOOTPRINT 1
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// this is tempory .. untill this is glued better into the panda build system // this is tempory .. untill this is glued better into the panda build system
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
@ -84,7 +86,7 @@ EXPCL_DTOOLCONFIG RunTimeTypeList & GetRunTimeTypeList();
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// used to stamp dtool instance.. // used to stamp dtool instance..
#define PY_PANDA_SIGNATURE 0xdeadbeaf #define PY_PANDA_SIGNATURE 0xbeaf
typedef void * ( * ConvertFunctionType )(PyObject *,Dtool_PyTypedObject * ); typedef void * ( * ConvertFunctionType )(PyObject *,Dtool_PyTypedObject * );
typedef void * ( * ConvertFunctionType1 )(void *, Dtool_PyTypedObject *); typedef void * ( * ConvertFunctionType1 )(void *, Dtool_PyTypedObject *);
typedef void ( *FreeFunction )(PyObject *); typedef void ( *FreeFunction )(PyObject *);
@ -96,6 +98,21 @@ inline void Dtool_Deallocate_General(PyObject * self);
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// THIS IS THE INSTANCE CONTAINER FOR ALL panda py objects.... // THIS IS THE INSTANCE CONTAINER FOR ALL panda py objects....
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#ifdef PY_PANDA_SMALLER_FOOTPRINT
// this should save 8 bytes per object ....
struct Dtool_PyInstDef
{
PyObject_HEAD
void *_ptr_to_object;
struct Dtool_PyTypedObject *_My_Type;
unsigned short _signature ;
int _memory_rules : 1; // true if we own the pointer and should delete it or unref it
int _is_const : 1; // true if this is a "const" pointer.
};
#else
struct Dtool_PyInstDef { struct Dtool_PyInstDef {
PyObject_HEAD PyObject_HEAD
void *_ptr_to_object; void *_ptr_to_object;
@ -104,6 +121,7 @@ struct Dtool_PyInstDef {
unsigned long _signature; unsigned long _signature;
struct Dtool_PyTypedObject *_My_Type; struct Dtool_PyTypedObject *_My_Type;
}; };
#endif
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// A Offset Dictionary Defining How to read the Above Object.. // A Offset Dictionary Defining How to read the Above Object..