X-Git-Url: https://git.llucax.com/software/druntime.git/blobdiff_plain/5a07183e26b7ca151959629420a83f59af5339f3..b4e307abd5e0e6f29d5726ac65878db14c4f07ae:/src/compiler/dmd/memory.d?ds=sidebyside diff --git a/src/compiler/dmd/memory.d b/src/compiler/dmd/memory.d index 7ed28b6..7ea24dd 100644 --- a/src/compiler/dmd/memory.d +++ b/src/compiler/dmd/memory.d @@ -37,6 +37,8 @@ private extern (C) extern void* __libc_stack_end; } } + extern (C) void gc_addRange( void* p, size_t sz ); + extern (C) void gc_removeRange( void *p ); } @@ -130,23 +132,18 @@ private alias __data_start Data_Start; alias _end Data_End; } - - alias void delegate( void*, void* ) scanFn; } -/** - * - */ -extern (C) void rt_scanStaticData( scanFn scan ) +void initStaticDataGC() { version( Windows ) { - scan( &_xi_a, &_end ); + gc_addRange( &_xi_a, cast(size_t) &_end - cast(size_t) &_xi_a ); } else version( linux ) { - scan( &__data_start, &_end ); + gc_addRange( &__data_start, cast(size_t) &_end - cast(size_t) &__data_start ); } else {