From b3732c5935f20f9a6e425f7228333c8042922d75 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 30 Jul 2019 08:53:30 +0900 Subject: [PATCH] Replace `in` with `const scope` for gc implementations --- src/core/gc/gcinterface.d | 2 +- src/core/memory.d | 16 ++++++++-------- src/gc/impl/conservative/gc.d | 10 +++++----- src/gc/impl/manual/gc.d | 2 +- src/gc/impl/proto/gc.d | 6 +++--- src/gc/proxy.d | 2 +- test/init_fini/src/custom_gc.d | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/core/gc/gcinterface.d b/src/core/gc/gcinterface.d index 223f05f9a7..9b2b5f678b 100644 --- a/src/core/gc/gcinterface.d +++ b/src/core/gc/gcinterface.d @@ -182,7 +182,7 @@ interface GC /** * run finalizers */ - void runFinalizers(in void[] segment) nothrow; + void runFinalizers(const scope void[] segment) nothrow; /* * diff --git a/src/core/memory.d b/src/core/memory.d index 661ff20baa..8034da749b 100644 --- a/src/core/memory.d +++ b/src/core/memory.d @@ -141,11 +141,11 @@ private extern (C) GC.Stats gc_stats ( ) nothrow @nogc; extern (C) GC.ProfileStats gc_profileStats ( ) nothrow @nogc @safe; - extern (C) void gc_addRoot( const scope void* p ) nothrow @nogc; - extern (C) void gc_addRange( const scope void* p, size_t sz, const TypeInfo ti = null ) nothrow @nogc; + extern (C) void gc_addRoot(const void* p ) nothrow @nogc; + extern (C) void gc_addRange(const void* p, size_t sz, const TypeInfo ti = null ) nothrow @nogc; - extern (C) void gc_removeRoot( const scope void* p ) nothrow @nogc; - extern (C) void gc_removeRange( const scope void* p ) nothrow @nogc; + extern (C) void gc_removeRoot(const void* p ) nothrow @nogc; + extern (C) void gc_removeRange(const void* p ) nothrow @nogc; extern (C) void gc_runFinalizers( const scope void[] segment ); package extern (C) bool gc_inFinalizer(); @@ -764,7 +764,7 @@ struct GC * } * --- */ - static void addRoot( const scope void* p ) nothrow @nogc /* FIXME pure */ + static void addRoot(const void* p ) nothrow @nogc /* FIXME pure */ { gc_addRoot( p ); } @@ -778,7 +778,7 @@ struct GC * Params: * p = A pointer into a GC-managed memory block or null. */ - static void removeRoot( const scope void* p ) nothrow @nogc /* FIXME pure */ + static void removeRoot(const void* p ) nothrow @nogc /* FIXME pure */ { gc_removeRoot( p ); } @@ -812,7 +812,7 @@ struct GC * // rawMemory will be recognized on collection. * --- */ - static void addRange( const scope void* p, size_t sz, const TypeInfo ti = null ) @nogc nothrow /* FIXME pure */ + static void addRange(const void* p, size_t sz, const TypeInfo ti = null ) @nogc nothrow /* FIXME pure */ { gc_addRange( p, sz, ti ); } @@ -827,7 +827,7 @@ struct GC * Params: * p = A pointer to a valid memory address or to null. */ - static void removeRange( const scope void* p ) nothrow @nogc /* FIXME pure */ + static void removeRange(const void* p ) nothrow @nogc /* FIXME pure */ { gc_removeRange( p ); } diff --git a/src/gc/impl/conservative/gc.d b/src/gc/impl/conservative/gc.d index 19aa70de14..bad48842a9 100644 --- a/src/gc/impl/conservative/gc.d +++ b/src/gc/impl/conservative/gc.d @@ -970,9 +970,9 @@ class ConservativeGC : GC } - void runFinalizers(in void[] segment) nothrow + void runFinalizers(const scope void[] segment) nothrow { - static void go(Gcx* gcx, in void[] segment) nothrow + static void go(Gcx* gcx, const scope void[] segment) nothrow { gcx.runFinalizers(segment); } @@ -1459,7 +1459,7 @@ struct Gcx /** * */ - void runFinalizers(in void[] segment) nothrow + void runFinalizers(const scope void[] segment) nothrow { ConservativeGC._inFinalizer = true; scope (failure) ConservativeGC._inFinalizer = false; @@ -3641,7 +3641,7 @@ struct LargeObjectPool return info; } - void runFinalizers(in void[] segment) nothrow + void runFinalizers(const scope void[] segment) nothrow { foreach (pn; 0 .. npages) { @@ -3755,7 +3755,7 @@ struct SmallObjectPool return info; } - void runFinalizers(in void[] segment) nothrow + void runFinalizers(const scope void[] segment) nothrow { foreach (pn; 0 .. npages) { diff --git a/src/gc/impl/manual/gc.d b/src/gc/impl/manual/gc.d index 292a5b26d7..7f65a444b6 100644 --- a/src/gc/impl/manual/gc.d +++ b/src/gc/impl/manual/gc.d @@ -264,7 +264,7 @@ class ManualGC : GC return 0; } - void runFinalizers(in void[] segment) nothrow + void runFinalizers(const scope void[] segment) nothrow { } diff --git a/src/gc/impl/proto/gc.d b/src/gc/impl/proto/gc.d index 2d6fc3685c..559d9f9a61 100644 --- a/src/gc/impl/proto/gc.d +++ b/src/gc/impl/proto/gc.d @@ -24,8 +24,8 @@ private extern (C) void* gc_realloc( void* p, size_t sz, uint ba = 0, const TypeInfo = null ) pure nothrow; extern (C) size_t gc_reserve( size_t sz ) nothrow; - extern (C) void gc_addRange( void* p, size_t sz, const TypeInfo ti = null ) nothrow @nogc; - extern (C) void gc_addRoot( void* p ) nothrow @nogc; + extern (C) void gc_addRange(const void* p, size_t sz, const TypeInfo ti = null ) nothrow @nogc; + extern (C) void gc_addRoot(const void* p ) nothrow @nogc; } class ProtoGC : GC @@ -232,7 +232,7 @@ class ProtoGC : GC return 0; } - void runFinalizers(in void[] segment) nothrow + void runFinalizers(const scope void[] segment) nothrow { } diff --git a/src/gc/proxy.d b/src/gc/proxy.d index 81f7fff312..754d2495b8 100644 --- a/src/gc/proxy.d +++ b/src/gc/proxy.d @@ -240,7 +240,7 @@ extern (C) return instance.removeRange( p ); } - void gc_runFinalizers( in void[] segment ) nothrow + void gc_runFinalizers(const scope void[] segment ) nothrow { return instance.runFinalizers( segment ); } diff --git a/test/init_fini/src/custom_gc.d b/test/init_fini/src/custom_gc.d index 904896a38d..81a3033357 100644 --- a/test/init_fini/src/custom_gc.d +++ b/test/init_fini/src/custom_gc.d @@ -164,7 +164,7 @@ nothrow @nogc: return null; } - void runFinalizers(in void[] segment) nothrow + void runFinalizers(const scope void[] segment) nothrow { }