Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mak/COPY
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
COPY=\
$(IMPDIR)\object.d \
\
$(IMPDIR)\core\gc\config.d \
$(IMPDIR)\core\gc\gcinterface.d \
$(IMPDIR)\core\gc\registry.d \
\
$(IMPDIR)\core\atomic.d \
$(IMPDIR)\core\attribute.d \
$(IMPDIR)\core\bitop.d \
Expand Down
4 changes: 4 additions & 0 deletions mak/DOCS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ DOCS=\
$(DOCDIR)\core_time.html \
$(DOCDIR)\core_vararg.html \
\
$(DOCDIR)\core_gc_config.html \
$(DOCDIR)\core_gc_gcinterface.html \
$(DOCDIR)\core_gc_registry.html \
\
$(DOCDIR)\core_stdc_assert_.html \
$(DOCDIR)\core_stdc_config.html \
$(DOCDIR)\core_stdc_complex.html \
Expand Down
7 changes: 4 additions & 3 deletions mak/SRCS
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ SRCS=\
src\core\time.d \
src\core\vararg.d \
\
src\core\gc\config.d \
src\core\gc\gcinterface.d \
src\core\gc\registry.d \
\
src\core\internal\abort.d \
src\core\internal\arrayop.d \
src\core\internal\convert.d \
Expand Down Expand Up @@ -388,13 +392,10 @@ SRCS=\
src\core\sys\windows\wtypes.d \
\
src\gc\bits.d \
src\gc\config.d \
src\gc\gcinterface.d \
src\gc\impl\conservative\gc.d \
src\gc\os.d \
src\gc\pooltable.d \
src\gc\proxy.d \
src\gc\registry.d \
src\gc\impl\manual\gc.d \
src\gc\impl\proto\gc.d \
\
Expand Down
9 changes: 9 additions & 0 deletions mak/WINDOWS
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ $(IMPDIR)\core\time.d : src\core\time.d
$(IMPDIR)\core\vararg.d : src\core\vararg.d
copy $** $@

$(IMPDIR)\core\gc\config.d : src\core\gc\config.d
copy $** $@

$(IMPDIR)\core\gc\gcinterface.d : src\core\gc\gcinterface.d
copy $** $@

$(IMPDIR)\core\gc\registry.d : src\core\gc\registry.d
copy $** $@

$(IMPDIR)\core\internal\abort.d : src\core\internal\abort.d
copy $** $@

Expand Down
3 changes: 3 additions & 0 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ $(DOCDIR)/object.html : src/object.d $(DMD)
$(DOCDIR)/core_%.html : src/core/%.d $(DMD)
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<

$(DOCDIR)/core_gc_%.html : src/core/gc/%.d $(DMD)
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<

$(DOCDIR)/core_stdc_%.html : src/core/stdc/%.d $(DMD)
$(DMD) $(DDOCFLAGS) -Df$@ project.ddoc $(DOCFMT) $<

Expand Down
4 changes: 2 additions & 2 deletions src/gc/config.d → src/core/gc/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
*/

module gc.config;
module core.gc.config;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to expose this to the user and docs? Maybe make everything package for now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a GC implementation should be able to use the configuration even if it does not support all the values in there.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make everything package for now?

That would disallow accessing these modules from package gc AFAICT.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would disallow accessing these modules from package gc AFAICT.

Fair enough.


import core.stdc.stdio;
import core.internal.parseoptions;
Expand Down Expand Up @@ -34,7 +34,7 @@ struct Config

void help() @nogc nothrow
{
import gc.registry : registeredGCFactories;
import core.gc.registry : registeredGCFactories;

printf("GC options are specified as white space separated assignments:
disable:0|1 - start disabled (%d)
Expand Down
2 changes: 1 addition & 1 deletion src/gc/gcinterface.d → src/core/gc/gcinterface.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module gc.gcinterface;
module core.gc.gcinterface;

static import core.memory;
alias BlkAttr = core.memory.GC.BlkAttr;
Expand Down
6 changes: 3 additions & 3 deletions src/gc/registry.d → src/core/gc/registry.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Martin Nowak
*/
module gc.registry;
module core.gc.registry;

import gc.gcinterface : GC;
import core.gc.gcinterface : GC;

/*@nogc nothrow:*/

Expand Down Expand Up @@ -71,7 +71,7 @@ GC createGCInstance(string name)
}

// list of all registerd GCs
package(gc) const(Entry[]) registeredGCFactories(scope int dummy=0) nothrow @nogc
const(Entry[]) registeredGCFactories(scope int dummy=0) nothrow @nogc
{
return entries;
}
Expand Down
8 changes: 4 additions & 4 deletions src/gc/impl/conservative/gc.d
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ module gc.impl.conservative.gc;

import gc.bits;
import gc.os;
import gc.config;
import gc.gcinterface;
import core.gc.config;
import core.gc.gcinterface;

import rt.util.container.treap;

Expand Down Expand Up @@ -106,13 +106,13 @@ alias GC gc_t;
// register GC in C constructor (_STI_)
extern(C) pragma(crt_constructor) void _d_register_conservative_gc()
{
import gc.registry;
import core.gc.registry;
registerGCFactory("conservative", &initialize);
}

extern(C) pragma(crt_constructor) void _d_register_precise_gc()
{
import gc.registry;
import core.gc.registry;
registerGCFactory("precise", &initialize_precise);
}

Expand Down
5 changes: 2 additions & 3 deletions src/gc/impl/manual/gc.d
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
*/
module gc.impl.manual.gc;

import gc.config;
import gc.gcinterface;
import core.gc.gcinterface;

import rt.util.container.array;

Expand All @@ -38,7 +37,7 @@ extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure
// register GC in C constructor (_STI_)
extern(C) pragma(crt_constructor) void _d_register_manual_gc()
{
import gc.registry;
import core.gc.registry;
registerGCFactory("manual", &initialize);
}

Expand Down
3 changes: 1 addition & 2 deletions src/gc/impl/proto/gc.d
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

module gc.impl.proto.gc;

import gc.config;
import gc.gcinterface;
import core.gc.gcinterface;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this file import the declarations from gc.proxy instead of defining the headers again?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. Do you prefer a cyclic dependency and a public import in gc.proxy over a simple import of the public module?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you prefer a cyclic dependency

Ah sorry. Nevermind then.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't see the gc_* declarations in the diff. I think we have these declarations elsewhere too, e.g. core.memory. IIRC this is done to fake some attributes.


import rt.util.container.array;

Expand Down
6 changes: 3 additions & 3 deletions src/gc/proxy.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
module gc.proxy;

import gc.impl.proto.gc;
import gc.config;
import gc.gcinterface;
import gc.registry : createGCInstance;
import core.gc.config;
import core.gc.gcinterface;
import core.gc.registry : createGCInstance;

static import core.memory;

Expand Down
4 changes: 2 additions & 2 deletions test/init_fini/src/custom_gc.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gc.registry;
import gc.gcinterface;
import core.gc.registry;
import core.gc.gcinterface;
import core.stdc.stdlib;

static import core.memory;
Expand Down