From e7e6ed8fb86d75f90eb078b1103e84d9267c8f03 Mon Sep 17 00:00:00 2001 From: chyyran Date: Sat, 10 Aug 2024 23:56:15 -0400 Subject: [PATCH] capi: remove _internal_alloc from libra_preset_param_list_t --- include/librashader.h | 6 ++---- librashader-capi/src/presets.rs | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/librashader.h b/include/librashader.h index e38c054..eb5ef5d 100644 --- a/include/librashader.h +++ b/include/librashader.h @@ -155,11 +155,9 @@ typedef struct libra_preset_param_t { typedef struct libra_preset_param_list_t { /// A pointer to the parameter const struct libra_preset_param_t *parameters; - /// The number of parameters in the list. + /// The number of parameters in the list. This field is readonly, + /// changing it will lead to undefined behaviour on free. uint64_t length; - /// For internal use only. - /// Changing this causes immediate undefined behaviour on freeing this parameter list. - uint64_t _internal_alloc; } libra_preset_param_list_t; #if defined(LIBRA_RUNTIME_OPENGL) diff --git a/librashader-capi/src/presets.rs b/librashader-capi/src/presets.rs index 2c7c8f5..8bafff4 100644 --- a/librashader-capi/src/presets.rs +++ b/librashader-capi/src/presets.rs @@ -14,11 +14,10 @@ const _: () = crate::assert_thread_safe::(); pub struct libra_preset_param_list_t { /// A pointer to the parameter pub parameters: *const libra_preset_param_t, - /// The number of parameters in the list. + /// The number of parameters in the list. This field + /// is readonly, and changing it will lead to undefined + /// behaviour on free. pub length: u64, - /// For internal use only. - /// Changing this causes immediate undefined behaviour on freeing this parameter list. - pub _internal_alloc: u64, } /// A preset parameter. @@ -226,7 +225,6 @@ extern_fn! { out.write(MaybeUninit::new(libra_preset_param_list_t { parameters: parts, length: len as u64, - _internal_alloc: 0, })); } }