提交 5cd017d5 编写于 作者: P Peter Krempa

util: Move VIR_AUTOUNREF definition to virobject.h

This helper has solely to do with virObjects. Move it together with
other virObject stuff.

This also avoids the potential problem where VIR_AUTOUNREF uses
virObjectAutoUnref which is defined in virobject.h.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 dfa00118
......@@ -682,15 +682,4 @@ void virAllocTestHook(void (*func)(int, void*), void *data);
# define VIR_AUTOCLEAN(type) \
__attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) type
/**
* VIR_AUTOUNREF:
* @type: type of an virObject subclass to be unref'd automatically
*
* Declares a variable of @type which will be automatically unref'd when
* control goes out of the scope.
*/
# define VIR_AUTOUNREF(type) \
__attribute__((cleanup(virObjectAutoUnref))) type
#endif /* LIBVIRT_VIRALLOC_H */
......@@ -113,6 +113,16 @@ virObjectUnref(void *obj);
void
virObjectAutoUnref(void *objptr);
/**
* VIR_AUTOUNREF:
* @type: type of an virObject subclass to be unref'd automatically
*
* Declares a variable of @type which will be automatically unref'd when
* control goes out of the scope.
*/
# define VIR_AUTOUNREF(type) \
__attribute__((cleanup(virObjectAutoUnref))) type
void *
virObjectRef(void *obj);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册