From ad4aa44a6b79a801543a1dab847e23e1a4820e7a Mon Sep 17 00:00:00 2001 From: Roger Hughston Date: Sat, 12 May 2007 01:16:04 +0000 Subject: [PATCH] If you pick this up you need to re interigate every thing you have --- dtool/src/interrogatedb/py_panda.cxx | 6 +++--- dtool/src/interrogatedb/py_panda.h | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 090c469df4..a924f5ad29 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -23,9 +23,9 @@ PyMemberDef standard_type_members[] = { {"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_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_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_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"}, {NULL} /* Sentinel */ }; diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 04f462cced..4f9b9adb93 100755 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -61,6 +61,8 @@ using namespace std; +#define PY_PANDA_SMALLER_FOOTPRINT 1 + /////////////////////////////////////////////////////////////////////////////////// // 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.. -#define PY_PANDA_SIGNATURE 0xdeadbeaf +#define PY_PANDA_SIGNATURE 0xbeaf typedef void * ( * ConvertFunctionType )(PyObject *,Dtool_PyTypedObject * ); typedef void * ( * ConvertFunctionType1 )(void *, Dtool_PyTypedObject *); 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.... //////////////////////////////////////////////////////////////////////// +#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 { PyObject_HEAD void *_ptr_to_object; @@ -104,6 +121,7 @@ struct Dtool_PyInstDef { unsigned long _signature; struct Dtool_PyTypedObject *_My_Type; }; +#endif //////////////////////////////////////////////////////////////////////// // A Offset Dictionary Defining How to read the Above Object..