Skip to content

Commit 4da37fe

Browse files
authored
Disable GC with USE_STANDARD_MALLOC for seq_init() (#662)
1 parent 54d0601 commit 4da37fe

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

codon/runtime/lib.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* General
3434
*/
3535

36+
#define USE_STANDARD_MALLOC 0
37+
3638
// OpenMP patch with GC callbacks
3739
typedef int (*gc_setup_callback)(GC_stack_base *);
3840
typedef void (*gc_roots_callback)(void *, void *);
@@ -50,11 +52,14 @@ void seq_nvptx_init();
5052
int seq_flags;
5153

5254
SEQ_FUNC void seq_init(int flags) {
55+
#if !USE_STANDARD_MALLOC
5356
GC_INIT();
5457
GC_set_warn_proc(GC_ignore_warn_proc);
5558
GC_allow_register_threads();
5659
__kmpc_set_gc_callbacks(GC_get_stack_base, (gc_setup_callback)GC_register_my_thread,
5760
GC_add_roots, GC_remove_roots);
61+
#endif
62+
5863
seq_exc_init(flags);
5964
#ifdef CODON_GPU
6065
seq_nvptx_init();
@@ -151,7 +156,6 @@ SEQ_FUNC char **seq_env() { return environ; }
151156
/*
152157
* GC
153158
*/
154-
#define USE_STANDARD_MALLOC 0
155159

156160
SEQ_FUNC void *seq_alloc(size_t n) {
157161
#if USE_STANDARD_MALLOC

0 commit comments

Comments
 (0)