@@ -91,9 +91,9 @@ static struct sctk_alloc_chain sctk_global_egg_chain;
91
91
/************************* FUNCTION ************************/
92
92
#ifdef MPC_check_compatibility
93
93
/** Defined in MPC **/
94
- int mpc_topology_get_current_cpu ();
94
+ int mpcalloc_topology_get_current_cpu ();
95
95
/** Defined in MPC **/
96
- int mpc_topology_get_numa_node_from_cpu (int cpu );
96
+ int mpcalloc_topology_get_numa_node_from_cpu (int cpu );
97
97
#endif
98
98
99
99
/*************************** FUNCTION **********************/
@@ -255,7 +255,7 @@ SCTK_INTERN void sctk_alloc_posix_mmsrc_numa_init_phase_numa(void)
255
255
256
256
//get number of nodes
257
257
SCTK_NO_PDEBUG ("Init numa nodes" );
258
- nodes = mpc_topology_get_numa_node_count ();
258
+ nodes = mpcalloc_topology_get_numa_node_count ();
259
259
assume_m (nodes <= SCTK_MAX_NUMA_NODE ,"Caution, you get more node than supported by allocator. Limit is setup by SCTK_MAX_NUMA_NODE macro in sctk_alloc_posix.c." );
260
260
261
261
//debug
@@ -272,7 +272,7 @@ SCTK_INTERN void sctk_alloc_posix_mmsrc_numa_init_phase_numa(void)
272
272
}
273
273
274
274
//setup malloc on node
275
- sctk_malloc_on_node_init (mpc_topology_get_numa_node_count ());
275
+ sctk_malloc_on_node_init (mpcalloc_topology_get_numa_node_count ());
276
276
#endif
277
277
278
278
//mark NUMA init phase as done.
@@ -307,7 +307,7 @@ int sctk_alloc_posix_source_round_robin(void) {
307
307
308
308
sctk_alloc_spinlock_lock (& lock );
309
309
res = cnt ;
310
- cnt = (cnt + 1 ) % mpc_topology_get_numa_node_count ();
310
+ cnt = (cnt + 1 ) % mpcalloc_topology_get_numa_node_count ();
311
311
sctk_alloc_spinlock_unlock (& lock );
312
312
return res ;
313
313
}
@@ -527,8 +527,6 @@ SCTK_INTERN struct sctk_alloc_chain * sctk_alloc_posix_setup_tls_chain(void)
527
527
//debug
528
528
SCTK_NO_PDEBUG ("sctk_alloc_posix_setup_tls_chain()" );
529
529
530
- //profiling
531
- SCTK_PROFIL_START (sctk_alloc_posix_setup_tls_chain );
532
530
533
531
//check errors
534
532
assert (sctk_get_tls_chain () == NULL );
@@ -542,8 +540,6 @@ SCTK_INTERN struct sctk_alloc_chain * sctk_alloc_posix_setup_tls_chain(void)
542
540
//make it default for current thread
543
541
sctk_alloc_posix_set_default_chain (chain );
544
542
545
- SCTK_PROFIL_END (sctk_alloc_posix_setup_tls_chain );
546
-
547
543
//return it
548
544
return chain ;
549
545
}
@@ -552,10 +548,9 @@ SCTK_INTERN struct sctk_alloc_chain * sctk_alloc_posix_setup_tls_chain(void)
552
548
SCTK_PUBLIC void * sctk_calloc (size_t nmemb , size_t size )
553
549
{
554
550
void * ptr ;
555
- SCTK_PROFIL_START ( sctk_calloc );
551
+
556
552
ptr = sctk_malloc (nmemb * size );
557
553
memset (ptr ,0 ,nmemb * size );
558
- SCTK_PROFIL_END (sctk_calloc );
559
554
return ptr ;
560
555
}
561
556
@@ -567,8 +562,6 @@ SCTK_PUBLIC void * sctk_malloc (size_t size)
567
562
struct sctk_alloc_chain * local_chain ;
568
563
void * res ;
569
564
570
- //profile
571
- SCTK_PROFIL_START (sctk_malloc );
572
565
573
566
//get TLS
574
567
local_chain = sctk_get_tls_chain ();
@@ -600,7 +593,7 @@ SCTK_PUBLIC void * sctk_malloc (size_t size)
600
593
//done allocation
601
594
res = sctk_alloc_chain_alloc (local_chain ,size );
602
595
SCTK_PTRACE ("void * ptr%p = malloc(%ld);//chain = %p" ,res ,size ,local_chain );
603
- SCTK_PROFIL_END ( sctk_malloc );
596
+
604
597
return res ;
605
598
}
606
599
@@ -611,8 +604,6 @@ SCTK_PUBLIC void * sctk_memalign(size_t boundary,size_t size)
611
604
struct sctk_alloc_chain * local_chain ;
612
605
void * res ;
613
606
614
- //profile
615
- SCTK_PROFIL_START (sctk_memalign );
616
607
617
608
//get TLS
618
609
local_chain = sctk_get_tls_chain ();
@@ -640,17 +631,17 @@ SCTK_PUBLIC void * sctk_memalign(size_t boundary,size_t size)
640
631
//done allocation
641
632
res = sctk_alloc_chain_alloc_align (local_chain ,boundary ,size );
642
633
SCTK_PTRACE ("void * ptr%p = memalign(%ld,%ld);//chain = %p" ,res ,boundary ,size ,local_chain );
643
- SCTK_PROFIL_END ( sctk_memalign );
634
+
644
635
return res ;
645
636
}
646
637
647
638
/************************* FUNCTION ************************/
648
639
SCTK_PUBLIC int sctk_posix_memalign (void * * memptr , size_t boundary , size_t size )
649
640
{
650
- SCTK_PROFIL_START ( sctk_posix_memalign );
641
+
651
642
assert (memptr != NULL );
652
643
* memptr = sctk_memalign (boundary ,size );
653
- SCTK_PROFIL_END ( sctk_posix_memalign );
644
+
654
645
if (memptr == NULL )
655
646
return ENOMEM ;
656
647
else
@@ -669,7 +660,7 @@ SCTK_PUBLIC void sctk_free (void * ptr)
669
660
static int cnt = 0 ;
670
661
#endif
671
662
672
- SCTK_PROFIL_START ( sctk_free );
663
+
673
664
local_chain = sctk_get_tls_chain ();
674
665
675
666
//setup the local chain if not already done
@@ -731,7 +722,7 @@ SCTK_PUBLIC void sctk_free (void * ptr)
731
722
SCTK_ALLOC_HOOK (chain_remote_free ,chain ,local_chain ,ptr );
732
723
sctk_alloc_rfq_register (& chain -> rfq ,ptr );
733
724
}
734
- SCTK_PROFIL_END ( sctk_free );
725
+
735
726
}
736
727
737
728
/************************* FUNCTION ************************/
@@ -792,7 +783,6 @@ SCTK_PUBLIC void * sctk_realloc (void * ptr, size_t size)
792
783
struct sctk_alloc_macro_bloc * macro_bloc = NULL ;
793
784
void * res = NULL ;
794
785
795
- SCTK_PROFIL_START (sctk_realloc );
796
786
797
787
//trivial cases
798
788
if (ptr == NULL )
@@ -852,7 +842,7 @@ SCTK_PUBLIC void * sctk_realloc (void * ptr, size_t size)
852
842
}
853
843
854
844
SCTK_PTRACE ("//ptr%p = realloc(ptr%p,%llu); //%p" ,res ,ptr ,size );
855
- SCTK_PROFIL_END ( sctk_realloc );
845
+
856
846
return res ;
857
847
}
858
848
@@ -861,7 +851,6 @@ void *sctk_realloc_inter_chain(void *ptr, size_t size) {
861
851
sctk_size_t copy_size = size ;
862
852
void * res = NULL ;
863
853
864
- SCTK_PROFIL_START (sctk_realloc_inter_chain );
865
854
866
855
// when using hooking, we need to know the chain
867
856
if (SCTK_ALLOC_HAS_HOOK (chain_next_is_realloc )) {
@@ -884,7 +873,6 @@ void *sctk_realloc_inter_chain(void *ptr, size_t size) {
884
873
if (ptr != NULL )
885
874
sctk_free (ptr );
886
875
887
- SCTK_PROFIL_END (sctk_realloc_inter_chain );
888
876
889
877
return res ;
890
878
}
@@ -935,10 +923,8 @@ SCTK_INTERN void sctk_alloc_posix_numa_migrate_chain(struct sctk_alloc_chain * c
935
923
int old_numa_node = -1 ;
936
924
int new_numa_node = -1 ;
937
925
938
- SCTK_PROFIL_START (sctk_alloc_posix_numa_migrate );
939
-
940
926
#ifdef MPC_Theads
941
- SCTK_NO_PDEBUG ("Migration on %d" ,mpc_topology_get_current_cpu ());
927
+ SCTK_NO_PDEBUG ("Migration on %d" ,mpcalloc_topology_get_current_cpu ());
942
928
#endif
943
929
944
930
//if NULL nothing to do otherwise remind the current mm source
@@ -964,7 +950,6 @@ SCTK_INTERN void sctk_alloc_posix_numa_migrate_chain(struct sctk_alloc_chain * c
964
950
if (old_numa_node != new_numa_node && new_numa_node != SCTK_DEFAULT_NUMA_MM_SOURCE_ID )
965
951
sctk_alloc_chain_numa_migrate (chain ,new_numa_node ,true,true,new_source );
966
952
967
- SCTK_PROFIL_END (sctk_alloc_posix_numa_migrate );
968
953
}
969
954
970
955
/************************* FUNCTION ************************/
0 commit comments