File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,16 @@ int main(int argc, char* argv[])
2424 auto rsize = snmalloc::sizeclass_to_size (sizeclass);
2525 if (rsize == size && align == 0 )
2626 {
27- outfile << " DEFINE_MALLOC_SIZE(malloc_size_ " << size << " _" << align << " , " << size
27+ outfile << " DEFINE_MALLOC_SIZE(__stack_alloc_small_ " << size << " _" << align << " , " << size
2828 << " );" << std::endl;
2929 }
3030 else
3131 {
32- outfile << " REDIRECT_MALLOC_SIZE(malloc_size_ " << size << " _" << align << " , malloc_size_ "
32+ outfile << " REDIRECT_MALLOC_SIZE(__stack_alloc_small_ " << size << " _" << align << " , __stack_alloc_small_ "
3333 << rsize << " _" << 0 << " );" << std::endl;
3434 }
35+ outfile << " GENERATE_FREE_SIZE(__stack_free_small_" << size << " _" << align << " );" << std::endl;
36+
3537 }
3638 }
3739
Original file line number Diff line number Diff line change 2020 return snmalloc::ThreadAlloc::get_noncachable ()->template alloc <s>(); \
2121 }
2222
23+ extern " C" void free_local_small (void * ptr)
24+ {
25+ if (snmalloc::Alloc::small_local_dealloc (ptr))
26+ return ;
27+ snmalloc::ThreadAlloc::get_noncachable ()->small_local_dealloc_slow (ptr);
28+ }
29+
30+ # define GENERATE_FREE_SIZE (a ) \
31+ __attribute__ ((alias(" free_local_small" ))) extern "C" void* a()
32+
2333#include " generated.cc"
You can’t perform that action at this time.
0 commit comments