diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-04-20 18:52:01 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-04-20 18:52:01 (GMT) |
commit | 8e5c8417e8ef79c1b475cb1b86a1754b24f9af78 (patch) | |
tree | 650a39bde7a5367995b471a562aa766febd505bc /plugins/pychrysa/helpers.h | |
parent | c177597d6da5dedb32aa176e8370db8ffb7f87aa (diff) |
Shared immediate operands in order to avoid useless allocations.
Diffstat (limited to 'plugins/pychrysa/helpers.h')
-rw-r--r-- | plugins/pychrysa/helpers.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/pychrysa/helpers.h b/plugins/pychrysa/helpers.h index 22f3702..3e079b7 100644 --- a/plugins/pychrysa/helpers.h +++ b/plugins/pychrysa/helpers.h @@ -65,5 +65,13 @@ bool PyDict_AddStringConstant(PyTypeObject *, const char *, const char *); bool register_class_for_pygobject(PyObject *, GType, PyTypeObject *, PyTypeObject *); +/** + * Quand on remplace un objet GLib dans le dos de Python, il faut + * le remplacer de la même manière qu'on l'a obtenu ! + */ + +#define pygobject_set(p, v) ((PyGObject *)(p))->obj = (GObject *)v + + #endif /* _PLUGINS_HELPERS_H */ |