Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-23 16:43:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-23 16:43:45 +0300
commit65bb4ff8d1042dc289c359ca08dc88e23e932a13 (patch)
treea12b0991174f8d9846cb5f01abdd8bb75ab209a3 /source/blender/python/intern/bpy_rna.h
parentf0f3d9a2fff6316b62634256e0cd46f508fb68a2 (diff)
py/rna api:
ifdef'd out weakref for blender/py api, worth testing to see if it adds much overhead.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.h')
-rw-r--r--source/blender/python/intern/bpy_rna.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index 6f812a27af7..e213ce90dae 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -39,21 +39,33 @@ extern PyTypeObject pyrna_prop_collection_Type;
#define BPy_PropertyRNA_Check(v) (PyObject_TypeCheck(v, &pyrna_prop_Type))
#define BPy_PropertyRNA_CheckExact(v) (Py_TYPE(v) == &pyrna_prop_Type)
+/* play it safe and keep optional for now, need to test further now this affects looping on 10000's of verts for eg. */
+// #define USE_WEAKREFS
+
typedef struct {
PyObject_HEAD /* required python macro */
- PointerRNA ptr;
+ PointerRNA ptr;
+#ifdef USE_WEAKREFS
+ PyObject *in_weakreflist;
+#endif
} BPy_DummyPointerRNA;
typedef struct {
PyObject_HEAD /* required python macro */
PointerRNA ptr;
int freeptr; /* needed in some cases if ptr.data is created on the fly, free when deallocing */
+#ifdef USE_WEAKREFS
+ PyObject *in_weakreflist;
+#endif
} BPy_StructRNA;
typedef struct {
PyObject_HEAD /* required python macro */
PointerRNA ptr;
PropertyRNA *prop;
+#ifdef USE_WEAKREFS
+ PyObject *in_weakreflist;
+#endif
} BPy_PropertyRNA;
typedef struct {
@@ -64,6 +76,9 @@ typedef struct {
/* Arystan: this is a hack to allow sub-item r/w access like: face.uv[n][m] */
int arraydim; /* array dimension, e.g: 0 for face.uv, 2 for face.uv[n][m], etc. */
int arrayoffset; /* array first item offset, e.g. if face.uv is [4][2], arrayoffset for face.uv[n] is 2n */
+#ifdef USE_WEAKREFS
+ PyObject *in_weakreflist;
+#endif
} BPy_PropertyArrayRNA;
/* cheap trick */