Skip to content

Commit 38b5bcc

Browse files
committed
Move *priv members to the end of internal structures
This commit moves provider_priv and pool_priv members in internal structures due to compatibility issues. From now, adding new ops will not break accessing these members.
1 parent 2e0f9e8 commit 38b5bcc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/memory_pool_internal.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ extern "C" {
2626

2727
typedef struct umf_memory_pool_t {
2828
void *pool_priv;
29-
umf_memory_pool_ops_t ops;
3029
umf_pool_create_flags_t flags;
3130

3231
// Memory provider used by the pool.
3332
umf_memory_provider_handle_t provider;
3433

3534
utils_mutex_t lock;
3635
void *tag;
36+
37+
// ops should be the last due to possible change size in the future
38+
umf_memory_pool_ops_t ops;
3739
} umf_memory_pool_t;
3840

3941
#ifdef __cplusplus

src/memory_provider_internal.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ extern "C" {
2121
#endif
2222

2323
typedef struct umf_memory_provider_t {
24-
umf_memory_provider_ops_t ops;
2524
void *provider_priv;
25+
// ops should be the last due to possible change size in the future
26+
umf_memory_provider_ops_t ops;
2627
} umf_memory_provider_t;
2728

2829
void *umfMemoryProviderGetPriv(umf_memory_provider_handle_t hProvider);

0 commit comments

Comments
 (0)