summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-22 11:38:00 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-23 18:09:36 +0200
commit3eb7b3793b0afcc79143a74a4052cb6179334f08 (patch)
tree116799cf117a08a098860f09c278b46a94c1cb9e /src/lib/eo
parent253e18159bbc601972cad4b3b42bbbe23cbf390d (diff)
eolian: start to express ownership transfere
before @owned was not even expressed in the api definitions of the generated APIs, this adds support for it. @owned is now expressed with EFL_TRANSFER_OWNERSHIP in a arguments. And that preprocessor directive is documented. Reviewed-by: Daniel Kolesa <daniel@octaforge.org> Differential Revision: https://phab.enlightenment.org/D9369
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/Eo.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 34c8a8c4b2..69fd84a560 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -212,6 +212,19 @@ EAPI extern unsigned int _efl_object_init_generation;
212 */ 212 */
213typedef void (*Efl_Del_Intercept) (Eo *obj_id); 213typedef void (*Efl_Del_Intercept) (Eo *obj_id);
214 214
215/**
216 * This is a no-operation. Its presence behind a function parameter indicates that
217 * ownership of the parameter is transferred to the callee.
218 * When present after a method, it indicates that the return value of the method is
219 * transferred to the caller.
220 * For objects, ownership transfer means that exactly one reference is transferred.
221 * If you transfer ownership without owning a reference in the first place, you will
222 * get unexpected behavior.
223 * For non-Objects, ownership transfer means that the responsibility of freeing a
224 * segment of memory is passed on.
225 */
226#define EFL_TRANSFER_OWNERSHIP
227
215#include "efl_object_override.eo.h" 228#include "efl_object_override.eo.h"
216#include "efl_object.eo.h" 229#include "efl_object.eo.h"
217 230
@@ -2369,6 +2382,7 @@ EAPI Eina_Iterator *eo_objects_iterator_new(void);
2369 * @return EINA_TRUE if the object is ownable. EINA_FALSE if not. 2382 * @return EINA_TRUE if the object is ownable. EINA_FALSE if not.
2370 */ 2383 */
2371EAPI Eina_Bool efl_ownable_get(const Eo *obj); 2384EAPI Eina_Bool efl_ownable_get(const Eo *obj);
2385
2372/** 2386/**
2373 * @} 2387 * @}
2374 */ 2388 */