@@ -87,12 +87,12 @@ static slab_t *create_slab(bucket_t *bucket, bool full_size) {
87
87
} else {
88
88
slab -> num_chunks_total = bucket_slab_min_size (bucket ) / bucket -> size ;
89
89
slab -> chunks =
90
- umf_ba_global_alloc (sizeof (bool ) * slab -> num_chunks_total );
90
+ umf_ba_global_alloc (sizeof (* slab -> chunks ) * slab -> num_chunks_total );
91
91
if (slab -> chunks == NULL ) {
92
92
LOG_ERR ("allocation of slab chunks failed!" );
93
93
goto free_slab_iter ;
94
94
}
95
- memset (slab -> chunks , 0 , sizeof (bool ) * slab -> num_chunks_total );
95
+ memset (slab -> chunks , 0 , sizeof (* slab -> chunks ) * slab -> num_chunks_total );
96
96
}
97
97
// if slab_min_size is not a multiple of bucket size, we would have some
98
98
// padding at the end of the slab
@@ -703,8 +703,8 @@ umf_result_t disjoint_pool_initialize(umf_memory_provider_handle_t provider,
703
703
for (; Size2 < CutOff ; Size1 *= 2 , Size2 *= 2 ) {
704
704
disjoint_pool -> buckets_num += 2 ;
705
705
}
706
- disjoint_pool -> buckets =
707
- umf_ba_global_alloc ( sizeof (bucket_t * ) * disjoint_pool -> buckets_num );
706
+ disjoint_pool -> buckets = umf_ba_global_alloc (
707
+ sizeof (* disjoint_pool -> buckets ) * disjoint_pool -> buckets_num );
708
708
709
709
int i = 0 ;
710
710
Size1 = ts1 ;
@@ -964,8 +964,7 @@ umf_memory_pool_ops_t *umfDisjointPoolOps(void) {
964
964
965
965
umf_disjoint_pool_shared_limits_t *
966
966
umfDisjointPoolSharedLimitsCreate (size_t max_size ) {
967
- umf_disjoint_pool_shared_limits_t * ptr =
968
- umf_ba_global_alloc (sizeof (umf_disjoint_pool_shared_limits_t ));
967
+ umf_disjoint_pool_shared_limits_t * ptr = umf_ba_global_alloc (sizeof (* ptr ));
969
968
//umf_ba_global_alloc(sizeof(*ptr));
970
969
ptr -> max_size = max_size ;
971
970
ptr -> total_size = 0 ;
@@ -1109,7 +1108,7 @@ umfDisjointPoolParamsSetName(umf_disjoint_pool_params_handle_t hParams,
1109
1108
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
1110
1109
}
1111
1110
1112
- char * newName = umf_ba_global_alloc (sizeof (char ) * (strlen (name ) + 1 ));
1111
+ char * newName = umf_ba_global_alloc (sizeof (* newName ) * (strlen (name ) + 1 ));
1113
1112
if (newName == NULL ) {
1114
1113
LOG_ERR ("cannot allocate memory for disjoint pool name" );
1115
1114
return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY ;
0 commit comments