Skip to content

Commit

Permalink
Also conditionally include headers. Remove more ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon committed Nov 26, 2024
1 parent b5966dc commit 2466414
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 20 deletions.
7 changes: 6 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ ifeq ($(USE_SYSTEM_LIBUV),0)
UV_HEADERS += uv.h
UV_HEADERS += uv/*.h
endif
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,work-stealing-queue.h gc-interface.h gc-tls.h gc-tls-common.h gc-tls-mmtk.h julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,work-stealing-queue.h gc-interface.h gc-tls-common.h julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
ifeq ($(WITH_MMTK), 1)
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-mmtk.h)
else
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-stock.h)
endif
ifeq ($(OS),WINNT)
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,win32_ucontext.h)
endif
Expand Down
4 changes: 0 additions & 4 deletions src/gc-mmtk.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#ifdef MMTK_GC

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Expand Down Expand Up @@ -30,5 +28,3 @@ JL_EXTENSION typedef struct _bigval_t {
#ifdef __cplusplus
}
#endif

#endif // MMTK_GC
1 change: 0 additions & 1 deletion src/gc-stacks.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is a part of Julia. License is MIT: https://julialang.org/license

#include "gc-common.h"
#include "gc-stock.h"
#include "threading.h"
#ifndef _OS_WINDOWS_
# include <sys/resource.h>
Expand Down
5 changes: 0 additions & 5 deletions src/gc-stock.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
. non-moving, precise mark and sweep collector
. pool-allocates small objects, keeps big objects on a simple list
*/
#ifndef MMTK_GC

#ifndef JL_GC_H
#define JL_GC_H

Expand Down Expand Up @@ -727,6 +725,3 @@ void _report_gc_finished(uint64_t pause, uint64_t freed, int full, int recollect
#endif

#endif


#endif // !MMTK_GC
4 changes: 0 additions & 4 deletions src/gc-tls-mmtk.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// This file is a part of Julia. License is MIT: https://julialang.org/license

#ifdef MMTK_GC

#include <assert.h>
#include "mmtkMutator.h"

Expand All @@ -17,5 +15,3 @@ typedef struct {
#ifdef __cplusplus
}
#endif

#endif // MMTK_GC
4 changes: 0 additions & 4 deletions src/gc-tls.h → src/gc-tls-stock.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// This file is a part of Julia. License is MIT: https://julialang.org/license

#ifndef MMTK_GC

// Meant to be included in "julia_threads.h"
#ifndef JL_GC_TLS_H
#define JL_GC_TLS_H
Expand Down Expand Up @@ -68,5 +66,3 @@ typedef struct {
#endif

#endif // JL_GC_TLS_H

#endif // MMTK_GC
2 changes: 1 addition & 1 deletion src/julia_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define JL_THREADS_H

#ifndef MMTK_GC
#include "gc-tls.h"
#include "gc-tls-stock.h"
#else
#include "gc-tls-mmtk.h"
#endif
Expand Down

0 comments on commit 2466414

Please sign in to comment.