@@ -271,50 +271,6 @@ void *AllocImpl_allocate_align(AllocImpl *ai, size_t Size, size_t Alignment,
271271 return (void *)ALIGN_UP ((size_t )Ptr, Alignment);
272272}
273273
274- size_t AllocImpl_sizeToIdx (AllocImpl *ai, size_t Size) {
275- assert (Size <= CutOff && " Unexpected size" );
276- assert (Size > 0 && " Unexpected size" );
277-
278- size_t MinBucketSize = (size_t )1 << ai->MinBucketSizeExp ;
279- if (Size < MinBucketSize) {
280- return 0 ;
281- }
282-
283- // Get the position of the leftmost set bit.
284- size_t position = getLeftmostSetBitPos (Size);
285-
286- auto isPowerOf2 = 0 == (Size & (Size - 1 ));
287- auto largerThanHalfwayBetweenPowersOf2 =
288- !isPowerOf2 && bool ((Size - 1 ) & (uint64_t (1 ) << (position - 1 )));
289- auto index = (position - ai->MinBucketSizeExp ) * 2 + (int )(!isPowerOf2) +
290- (int )largerThanHalfwayBetweenPowersOf2;
291-
292- return index;
293- }
294-
295- umf_disjoint_pool_shared_limits_t *AllocImpl_getLimits (AllocImpl *ai) {
296- if (ai->params .SharedLimits ) {
297- return ai->params .SharedLimits ;
298- } else {
299- return ai->DefaultSharedLimits ;
300- }
301- };
302-
303- bucket_t *AllocImpl_findBucket (AllocImpl *ai, size_t Size) {
304- auto calculatedIdx = AllocImpl_sizeToIdx (ai, Size);
305- bucket_t *bucket = ai->buckets [calculatedIdx];
306- assert (bucket_get_size (bucket) >= Size);
307- (void )bucket;
308-
309- if (calculatedIdx > 0 ) {
310- bucket_t *bucket_prev = ai->buckets [calculatedIdx - 1 ];
311- assert (bucket_get_size (bucket_prev) < Size);
312- (void )bucket_prev;
313- }
314-
315- return ai->buckets [calculatedIdx];
316- }
317-
318274umf_result_t AllocImpl_deallocate (AllocImpl *ai, void *Ptr, bool *ToPool) {
319275 if (Ptr == nullptr ) {
320276 return UMF_RESULT_SUCCESS;
@@ -370,27 +326,6 @@ umf_result_t AllocImpl_deallocate(AllocImpl *ai, void *Ptr, bool *ToPool) {
370326 return UMF_RESULT_SUCCESS;
371327}
372328
373- void AllocImpl_printStats (AllocImpl *ai, bool &TitlePrinted,
374- size_t &HighBucketSize, size_t &HighPeakSlabsInUse,
375- const std::string &MTName) {
376- (void )TitlePrinted; // TODO
377- (void )MTName; // TODO
378-
379- HighBucketSize = 0 ;
380- HighPeakSlabsInUse = 0 ;
381- for (size_t i = 0 ; i < ai->buckets_num ; i++) {
382- // TODO
383- // (*B).printStats(TitlePrinted, MTName);
384- bucket_t *bucket = ai->buckets [i];
385- HighPeakSlabsInUse =
386- utils_max (bucket->maxSlabsInUse , HighPeakSlabsInUse);
387- if (bucket->allocCount ) {
388- HighBucketSize =
389- utils_max (bucket_slab_alloc_size (bucket), HighBucketSize);
390- }
391- }
392- }
393-
394329umf_result_t DisjointPool::initialize (umf_memory_provider_handle_t provider,
395330 umf_disjoint_pool_params_t *parameters) {
396331 if (!provider) {
@@ -509,13 +444,3 @@ static umf_memory_pool_ops_t UMF_DISJOINT_POOL_OPS =
509444umf_memory_pool_ops_t *umfDisjointPoolOps (void ) {
510445 return &UMF_DISJOINT_POOL_OPS;
511446}
512-
513- // TODO remove
514- #ifdef __cplusplus
515- extern " C" {
516- #endif
517-
518- #ifdef __cplusplus
519- }
520- #endif
521- // end TODO remove
0 commit comments