Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
Il 10/05/22 20:21, Matteo Bruni ha scritto:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
libs/vkd3d/utils.c | 32 ++++++++++++++++++++++++++++++++ libs/vkd3d/vkd3d_private.h | 34 +++------------------------------- 2 files changed, 35 insertions(+), 31 deletions(-)
diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c index 824e9e44..8169b14b 100644 --- a/libs/vkd3d/utils.c +++ b/libs/vkd3d/utils.c @@ -893,6 +893,38 @@ bool vkd3d_get_program_name(char program_name[PATH_MAX])
#endif /* HAVE_DECL_PROGRAM_INVOCATION_NAME */
+void vkd3d_private_data_destroy(struct vkd3d_private_data *data) +{
- if (data->is_object)
IUnknown_Release(data->u.object);
- list_remove(&data->entry);
- vkd3d_free(data);
+}
+HRESULT vkd3d_private_store_init(struct vkd3d_private_store *store) +{
- int rc;
- list_init(&store->content);
- if ((rc = vkd3d_mutex_init(&store->mutex)))
ERR("Failed to initialize mutex, error %d.\n", rc);
- return hresult_from_errno(rc);
+}
+void vkd3d_private_store_destroy(struct vkd3d_private_store *store) +{
- struct vkd3d_private_data *data, *cursor;
- LIST_FOR_EACH_ENTRY_SAFE(data, cursor, &store->content, struct vkd3d_private_data, entry)
- {
vkd3d_private_data_destroy(data);
- }
- vkd3d_mutex_destroy(&store->mutex);
+}
- static struct vkd3d_private_data *vkd3d_private_store_get_private_data( const struct vkd3d_private_store *store, const GUID *tag) {
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index ad644682..c1dfccb8 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -462,37 +462,9 @@ struct vkd3d_private_data } u; };
-static inline void vkd3d_private_data_destroy(struct vkd3d_private_data *data) -{
- if (data->is_object)
IUnknown_Release(data->u.object);
- list_remove(&data->entry);
- vkd3d_free(data);
-}
-static inline HRESULT vkd3d_private_store_init(struct vkd3d_private_store *store) -{
- int rc;
- list_init(&store->content);
- if ((rc = vkd3d_mutex_init(&store->mutex)))
ERR("Failed to initialize mutex, error %d.\n", rc);
- return hresult_from_errno(rc);
-}
-static inline void vkd3d_private_store_destroy(struct vkd3d_private_store *store) -{
- struct vkd3d_private_data *data, *cursor;
- LIST_FOR_EACH_ENTRY_SAFE(data, cursor, &store->content, struct vkd3d_private_data, entry)
- {
vkd3d_private_data_destroy(data);
- }
- vkd3d_mutex_destroy(&store->mutex);
-} +void vkd3d_private_data_destroy(struct vkd3d_private_data *data); +HRESULT vkd3d_private_store_init(struct vkd3d_private_store *store); +void vkd3d_private_store_destroy(struct vkd3d_private_store *store);
HRESULT vkd3d_get_private_data(struct vkd3d_private_store *store, const GUID *tag, unsigned int *out_size, void *out); HRESULT vkd3d_set_private_data(struct vkd3d_private_store *store,