Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 3bdbed0

Browse files
committed
Move gc package to core.internal
Make the code accessible to the compiler, if it ever needs it. Also make it easier to implement one's own GC by exposing 'bits' and 'os', as we now 'support' custom GC.
1 parent d4487d8 commit 3bdbed0

File tree

14 files changed

+53
-34
lines changed

14 files changed

+53
-34
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ src/core/thread.d @MartinNowak @Burgos @jpf91 @ZombineDev
4242
src/core/time.d @jmdavis @schveiguy @CyberShadow
4343

4444
src/etc* @deadalnix @MartinNowak
45-
src/gc* @rainers @DmitryOlshansky @MartinNowak @leandro-lucarella-sociomantic
45+
src/core/internal/gc/* @rainers @DmitryOlshansky @MartinNowak @leandro-lucarella-sociomantic
4646

4747
src/object.d @andralex @MartinNowak
4848

mak/COPY

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ COPY=\
6161
$(IMPDIR)\core\internal\elf\dl.d \
6262
$(IMPDIR)\core\internal\elf\io.d \
6363
\
64+
$(IMPDIR)\core\internal\gc\bits.d \
65+
$(IMPDIR)\core\internal\gc\os.d \
66+
$(IMPDIR)\core\internal\gc\pooltable.d \
67+
$(IMPDIR)\core\internal\gc\proxy.d \
68+
$(IMPDIR)\core\internal\gc\impl\conservative\gc.d \
69+
$(IMPDIR)\core\internal\gc\impl\manual\gc.d \
70+
$(IMPDIR)\core\internal\gc\impl\proto\gc.d \
71+
\
6472
$(IMPDIR)\core\internal\container\array.d \
6573
$(IMPDIR)\core\internal\container\common.d \
6674
$(IMPDIR)\core\internal\container\hashtab.d \

mak/DOCS

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -513,17 +513,13 @@ DOCS=\
513513
\
514514
$(DOCDIR)\etc_linux_memoryerror.html \
515515
\
516-
$(DOCDIR)\gc_bits.html \
517-
$(DOCDIR)\gc_pooltable.html \
518-
$(DOCDIR)\gc_os.html \
519-
$(DOCDIR)\gc_proxy.html \
520-
\
521-
\
522-
$(DOCDIR)\gc_impl_conservative_gc.html \
523-
\
524-
$(DOCDIR)\gc_impl_manual_gc.html \
525-
\
526-
$(DOCDIR)\gc_impl_proto_gc.html \
516+
$(DOCDIR)\core_internal_gc_bits.html \
517+
$(DOCDIR)\core_internal_gc_os.html \
518+
$(DOCDIR)\core_internal_gc_pooltable.html \
519+
$(DOCDIR)\core_internal_gc_proxy.html \
520+
$(DOCDIR)\core_internal_gc_impl_conservative_gc.html \
521+
$(DOCDIR)\core_internal_gc_impl_manual_gc.html \
522+
$(DOCDIR)\core_internal_gc_impl_proto_gc.html \
527523
\
528524
$(DOCDIR)\rt_aApply.html \
529525
$(DOCDIR)\rt_aApplyR.html \

mak/SRCS

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ SRCS=\
6666
src\core\internal\elf\dl.d \
6767
src\core\internal\elf\io.d \
6868
\
69+
src\core\internal\gc\bits.d \
70+
src\core\internal\gc\os.d \
71+
src\core\internal\gc\pooltable.d \
72+
src\core\internal\gc\proxy.d \
73+
src\core\internal\gc\impl\conservative\gc.d \
74+
src\core\internal\gc\impl\manual\gc.d \
75+
src\core\internal\gc\impl\proto\gc.d \
76+
\
6977
src\core\internal\util\array.d \
7078
src\core\internal\util\math.d \
7179
\
@@ -510,14 +518,6 @@ SRCS=\
510518
src\core\thread\context.d \
511519
src\core\thread\package.d \
512520
\
513-
src\gc\bits.d \
514-
src\gc\impl\conservative\gc.d \
515-
src\gc\os.d \
516-
src\gc\pooltable.d \
517-
src\gc\proxy.d \
518-
src\gc\impl\manual\gc.d \
519-
src\gc\impl\proto\gc.d \
520-
\
521521
src\rt\aApply.d \
522522
src\rt\aApplyR.d \
523523
src\rt\aaA.d \

posix.mak

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,21 @@ $(DOCDIR)/core_internal_container_%.html : src/core/internal/container/%.d $(DMD
171171
$(DOCDIR)/core_internal_elf_%.html : src/core/internal/elf/%.d $(DMD)
172172
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<
173173

174+
$(DOCDIR)/core_internal_gc_%.html : src/core/internal/gc/%.d $(DMD)
175+
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<
176+
177+
$(DOCDIR)/core_internal_gc_impl_%.html : src/core/internal/gc/impl/%.d $(DMD)
178+
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<
179+
180+
$(DOCDIR)/core_internal_gc_impl_conservative_%.html : src/core/internal/gc/impl/conservative/%.d $(DMD)
181+
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<
182+
183+
$(DOCDIR)/core_internal_gc_impl_manual_%.html : src/core/internal/gc/impl/manual/%.d $(DMD)
184+
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<
185+
186+
$(DOCDIR)/core_internal_gc_impl_proto_%.html : src/core/internal/gc/impl/proto/%.d $(DMD)
187+
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<
188+
174189
$(DOCDIR)/core_internal_util_%.html : src/core/internal/util/%.d $(DMD)
175190
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<
176191

src/gc/bits.d renamed to src/core/internal/gc/bits.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* (See accompanying file LICENSE or copy at
1212
* http://www.boost.org/LICENSE_1_0.txt)
1313
*/
14-
module gc.bits;
14+
module core.internal.gc.bits;
1515

1616

1717
import core.bitop;

src/gc/impl/conservative/gc.d renamed to src/core/internal/gc/impl/conservative/gc.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* (See accompanying file LICENSE or copy at
1212
* http://www.boost.org/LICENSE_1_0.txt)
1313
*/
14-
module gc.impl.conservative.gc;
14+
module core.internal.gc.impl.conservative.gc;
1515

1616
// D Programming Language Garbage Collector implementation
1717

@@ -35,8 +35,8 @@ module gc.impl.conservative.gc;
3535
/***************************************************/
3636
version = COLLECT_PARALLEL; // parallel scanning
3737

38-
import gc.bits;
39-
import gc.os;
38+
import core.internal.gc.bits;
39+
import core.internal.gc.os;
4040
import core.gc.config;
4141
import core.gc.gcinterface;
4242

@@ -1238,7 +1238,7 @@ struct Gcx
12381238
debug(INVARIANT) bool inCollection;
12391239
uint disabled; // turn off collections if >0
12401240

1241-
import gc.pooltable;
1241+
import core.internal.gc.pooltable;
12421242
private @property size_t npools() pure const nothrow { return pooltable.length; }
12431243
PoolTable!Pool pooltable;
12441244

src/gc/impl/manual/gc.d renamed to src/core/internal/gc/impl/manual/gc.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* (See accompanying file LICENSE or copy at
2424
* http://www.boost.org/LICENSE_1_0.txt)
2525
*/
26-
module gc.impl.manual.gc;
26+
module core.internal.gc.impl.manual.gc;
2727

2828
import core.gc.gcinterface;
2929

src/gc/impl/proto/gc.d renamed to src/core/internal/gc/impl/proto/gc.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
module gc.impl.proto.gc;
2+
module core.internal.gc.impl.proto.gc;
33

44
import core.gc.gcinterface;
55

src/gc/os.d renamed to src/core/internal/gc/os.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* (See accompanying file LICENSE or copy at
1212
* http://www.boost.org/LICENSE_1_0.txt)
1313
*/
14-
module gc.os;
14+
module core.internal.gc.os;
1515

1616

1717
version (Windows)
@@ -123,7 +123,7 @@ else static if (is(typeof(malloc))) // else version (GC_Use_Alloc_Malloc)
123123
// after PAGESIZE bytes used by the GC.
124124

125125

126-
import gc.impl.conservative.gc;
126+
import core.internal.gc.impl.conservative.gc;
127127

128128

129129
const size_t PAGE_MASK = PAGESIZE - 1;

0 commit comments

Comments
 (0)