@@ -151,7 +151,7 @@ namespace snmalloc
151151 if (post_teardown)
152152 {
153153#ifdef SNMALLOC_TRACING
154- std::cout << " post_teardown flush()" << std::endl ;
154+ message< 1024 >( " post_teardown flush()" ) ;
155155#endif
156156 // We didn't have an allocator because the thread is being torndown.
157157 // We need to return any local state, so we don't leak it.
@@ -188,8 +188,7 @@ namespace snmalloc
188188 // set up meta data so sizeclass is correct, and hence alloc size, and
189189 // external pointer.
190190#ifdef SNMALLOC_TRACING
191- std::cout << " size " << size << " pow2 size "
192- << bits::next_pow2_bits (size) << std::endl;
191+ message<1024 >(" size {} pow2size {}" , size, bits::next_pow2_bits (size));
193192#endif
194193
195194 // Initialise meta data for a successful large allocation.
@@ -263,8 +262,10 @@ namespace snmalloc
263262 if (core_alloc != nullptr )
264263 {
265264#ifdef SNMALLOC_TRACING
266- std::cout << " Remote dealloc post" << p.unsafe_ptr () << " size "
267- << alloc_size (p.unsafe_ptr ()) << std::endl;
265+ message<1024 >(
266+ " Remote dealloc post {} ({})" ,
267+ p.unsafe_ptr (),
268+ alloc_size (p.unsafe_ptr ()));
268269#endif
269270 const MetaslabMetaEntry& entry =
270271 SharedStateHandle::Pagemap::template get_metaentry<MetaslabMetaEntry>(
@@ -364,8 +365,7 @@ namespace snmalloc
364365 c->attach (&local_cache);
365366 core_alloc = c;
366367#ifdef SNMALLOC_TRACING
367- std::cout << " init(): core_alloc=" << core_alloc << " @" << &local_cache
368- << std::endl;
368+ message<1024 >(" init(): core_alloc={} @ {}" , core_alloc, &local_cache);
369369#endif
370370 // local_cache.stats.sta rt();
371371 }
@@ -407,7 +407,7 @@ namespace snmalloc
407407 // it is new to hit slow paths.
408408 core_alloc = nullptr ;
409409#ifdef SNMALLOC_TRACING
410- std::cout << " flush(): core_alloc=" << core_alloc << std::endl ;
410+ message< 1024 >( " flush(): core_alloc={} " , core_alloc) ;
411411#endif
412412 local_cache.remote_allocator = &SharedStateHandle::unused_remote;
413413 local_cache.remote_dealloc_cache .capacity = 0 ;
@@ -651,8 +651,8 @@ namespace snmalloc
651651 local_cache.remote_dealloc_cache .template dealloc <sizeof (CoreAlloc)>(
652652 entry.get_remote ()->trunc_id (), p_tame, key_global);
653653# ifdef SNMALLOC_TRACING
654- std::cout << " Remote dealloc fast " << p_raw << " size "
655- << alloc_size (p_raw) << std::endl ;
654+ message< 1024 >(
655+ " Remote dealloc fast {} ({}) " , p_raw, alloc_size (p_raw)) ;
656656# endif
657657 return ;
658658 }
@@ -667,7 +667,7 @@ namespace snmalloc
667667 snmalloc_check_client (p_tame == nullptr , " Not allocated by snmalloc." );
668668
669669# ifdef SNMALLOC_TRACING
670- std::cout << " nullptr deallocation" << std::endl ;
670+ message< 1024 >( " nullptr deallocation" ) ;
671671# endif
672672 return ;
673673#endif
@@ -689,8 +689,7 @@ namespace snmalloc
689689 void teardown ()
690690 {
691691#ifdef SNMALLOC_TRACING
692- std::cout << " Teardown: core_alloc=" << core_alloc << " @" << &local_cache
693- << std::endl;
692+ message<1024 >(" Teardown: core_alloc={} @ {}" , core_alloc, &local_cache);
694693#endif
695694 post_teardown = true ;
696695 if (core_alloc != nullptr )
0 commit comments