File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,8 @@ umf_ba_pool_t *umf_ba_create(size_t size) {
144
144
char * data_ptr = (char * )& pool -> data ;
145
145
size_t size_left = pool_size - offsetof(umf_ba_pool_t , data );
146
146
147
+ align_ptr_size ((void * * )& data_ptr , & size_left , MEMORY_ALIGNMENT );
148
+
147
149
// allocate and init free_lock
148
150
pool -> metadata .free_lock = util_mutex_init (data_ptr );
149
151
if (!pool -> metadata .free_lock ) {
@@ -178,9 +180,12 @@ void *umf_ba_alloc(umf_ba_pool_t *pool) {
178
180
pool -> metadata .n_pools ++ ;
179
181
#endif /* NDEBUG */
180
182
181
- size_t size =
183
+ char * data_ptr = (char * )& new_pool -> data ;
184
+ size_t size_left =
182
185
pool -> metadata .pool_size - offsetof(umf_ba_next_pool_t , data );
183
- ba_divide_memory_into_chunks (pool , & new_pool -> data , size );
186
+
187
+ align_ptr_size ((void * * )& data_ptr , & size_left , MEMORY_ALIGNMENT );
188
+ ba_divide_memory_into_chunks (pool , data_ptr , size_left );
184
189
}
185
190
186
191
umf_ba_chunk_t * chunk = pool -> metadata .free_list ;
You can’t perform that action at this time.
0 commit comments