Skip to content

Clean up of gc debugging and page management code #16385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 19, 2016
4 changes: 2 additions & 2 deletions base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# high-resolution relative time, in nanoseconds
time_ns() = ccall(:jl_hrtime, UInt64, ())

# This type must be kept in sync with the C struct in src/gc.c
# This type must be kept in sync with the C struct in src/gc.h
immutable GC_Num
allocd ::Int64 # GC internal
freed ::Int64 # GC internal
Expand Down Expand Up @@ -40,7 +40,7 @@ immutable GC_Diff
end

function GC_Diff(new::GC_Num, old::GC_Num)
# logic from gc.c:jl_gc_total_bytes
# logic from `src/gc.c:jl_gc_total_bytes`
old_allocd = old.allocd + Int64(old.collect) + Int64(old.total_allocd)
new_allocd = new.allocd + Int64(new.collect) + Int64(new.total_allocd)
return GC_Diff(new_allocd - old_allocd,
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SRCS := \
jltypes gf typemap ast builtins module interpreter \
alloc dlload sys init task array dump toplevel jl_uv jlapi signal-handling \
simplevector APInt-C runtime_intrinsics runtime_ccall \
threadgroup threading stackwalk gc safepoint
threadgroup threading stackwalk gc gc-debug gc-pages safepoint

ifeq ($(JULIACODEGEN),LLVM)
SRCS += codegen disasm debuginfo llvm-simdloop llvm-gcroot
Expand Down Expand Up @@ -117,7 +117,9 @@ $(BUILDDIR)/anticodegen.o $(BUILDDIR)/anticodegen.dbg.obj: $(SRCDIR)/intrinsics.
$(BUILDDIR)/debuginfo.o $(BUILDDIR)/debuginfo.dbg.obj: $(SRCDIR)/codegen_internal.h
$(BUILDDIR)/disasm.o $(BUILDDIR)/disasm.dbg.obj: $(SRCDIR)/codegen_internal.h
$(BUILDDIR)/builtins.o $(BUILDDIR)/builtins.dbg.obj: $(SRCDIR)/table.c
$(BUILDDIR)/gc.o $(BUILDDIR)/gc.dbg.obj: $(SRCDIR)/gc-debug.c
$(BUILDDIR)/gc.o $(BUILDDIR)/gc.dbg.obj: $(SRCDIR)/gc.h
$(BUILDDIR)/gc-debug.o $(BUILDDIR)/gc-debug.dbg.obj: $(SRCDIR)/gc.h
$(BUILDDIR)/gc-pages.o $(BUILDDIR)/gc-pages.dbg.obj: $(SRCDIR)/gc.h
$(BUILDDIR)/signal-handling.o $(BUILDDIR)/signal-handling.dbg.obj: $(addprefix $(SRCDIR)/,signals-*.c)
$(BUILDDIR)/dump.o $(BUILDDIR)/dump.dbg.obj: $(addprefix $(SRCDIR)/,common_symbols1.inc common_symbols2.inc)
$(addprefix $(BUILDDIR)/,threading.o threading.dbg.obj gc.o gc.dbg.obj init.c init.dbg.obj task.o task.dbg.obj): $(addprefix $(SRCDIR)/,threading.h threadgroup.h)
Expand Down
Loading