mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
dfa0011826
commit
5cd017d563
@ -682,15 +682,4 @@ void virAllocTestHook(void (*func)(int, void*), void *data);
|
|||||||
# define VIR_AUTOCLEAN(type) \
|
# define VIR_AUTOCLEAN(type) \
|
||||||
__attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) 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 */
|
#endif /* LIBVIRT_VIRALLOC_H */
|
||||||
|
@ -113,6 +113,16 @@ virObjectUnref(void *obj);
|
|||||||
void
|
void
|
||||||
virObjectAutoUnref(void *objptr);
|
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 *
|
void *
|
||||||
virObjectRef(void *obj);
|
virObjectRef(void *obj);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user