@@ -7,6 +7,7 @@ use std::{
77} ;
88
99use humansize:: { DECIMAL , format_size} ;
10+ use mimalloc_safe:: MiMalloc ;
1011
1112use oxc_allocator:: Allocator ;
1213use oxc_parser:: { ParseOptions , Parser } ;
@@ -38,28 +39,27 @@ fn reset_global_allocs() {
3839#[ expect( unsafe_code, clippy:: undocumented_unsafe_blocks) ]
3940unsafe impl GlobalAlloc for TrackedAllocator {
4041 unsafe fn alloc ( & self , layout : Layout ) -> * mut u8 {
41- let ret = unsafe { mimalloc_safe :: MiMalloc . alloc ( layout) } ;
42+ let ret = unsafe { MiMalloc . alloc ( layout) } ;
4243 if !ret. is_null ( ) {
4344 NUM_ALLOC . fetch_add ( 1 , SeqCst ) ;
4445 }
4546 ret
4647 }
4748
4849 unsafe fn dealloc ( & self , ptr : * mut u8 , layout : Layout ) {
49- unsafe {
50- mimalloc_safe:: MiMalloc . dealloc ( ptr, layout) ;
51- }
50+ unsafe { MiMalloc . dealloc ( ptr, layout) } ;
5251 }
5352
5453 unsafe fn alloc_zeroed ( & self , layout : Layout ) -> * mut u8 {
55- let ret = unsafe { mimalloc_safe :: MiMalloc . alloc_zeroed ( layout) } ;
54+ let ret = unsafe { MiMalloc . alloc_zeroed ( layout) } ;
5655 if !ret. is_null ( ) {
5756 NUM_ALLOC . fetch_add ( 1 , SeqCst ) ;
5857 }
5958 ret
6059 }
60+
6161 unsafe fn realloc ( & self , ptr : * mut u8 , layout : Layout , new_size : usize ) -> * mut u8 {
62- let ret = unsafe { mimalloc_safe :: MiMalloc . realloc ( ptr, layout, new_size) } ;
62+ let ret = unsafe { MiMalloc . realloc ( ptr, layout, new_size) } ;
6363 if !ret. is_null ( ) {
6464 NUM_REALLOC . fetch_add ( 1 , SeqCst ) ;
6565 }
0 commit comments