X-Git-Url: https://git.llucax.com/software/druntime.git/blobdiff_plain/3d4bc628056638dd5b264e8315b5e7b7fcf579e8..ee7c028ebdd89ffc05410551c6e4812187049279:/src/compiler/dmd/memory.d diff --git a/src/compiler/dmd/memory.d b/src/compiler/dmd/memory.d index 4f7188b..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,55 +132,21 @@ private alias __data_start Data_Start; alias _end Data_End; } - - alias void delegate( void*, void* ) scanFn; -} - - -/** - * - */ -extern (C) void rt_scanStaticData( scanFn scan ) -{ - scan(rt_staticDataBottom(), rt_staticDataTop()); } -/** - * - */ -extern (C) void* rt_staticDataBottom() -{ - version( Windows ) - { - return &_xi_a; - } - else version( linux ) - { - return &__data_start; - } - else - { - static assert( false, "Operating system not supported." ); - } -} -/** - * - */ -extern (C) void* rt_staticDataTop() +void initStaticDataGC() { version( Windows ) { - return &_end; + gc_addRange( &_xi_a, cast(size_t) &_end - cast(size_t) &_xi_a ); } else version( linux ) { - return &_end; + gc_addRange( &__data_start, cast(size_t) &_end - cast(size_t) &__data_start ); } else { static assert( false, "Operating system not supported." ); } } - -