Skip to content

Commit 6cb71e7

Browse files
authored
NFC: clenaup jl_gc_set_max_memory a bit (JuliaLang#55110)
This code is quite contrived. Let's simplify it a bit.
1 parent aba6766 commit 6cb71e7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/gc.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4015,14 +4015,10 @@ void jl_gc_init(void)
40154015

40164016
JL_DLLEXPORT void jl_gc_set_max_memory(uint64_t max_mem)
40174017
{
4018-
if (max_mem > 0
4019-
&& max_mem < (uint64_t)1 << (sizeof(memsize_t) * 8 - 1)) {
4020-
#ifdef _P64
4021-
max_total_memory = max_mem;
4022-
#else
4023-
max_total_memory = max_mem < MAX32HEAP ? max_mem : MAX32HEAP;
4024-
#endif
4025-
}
4018+
#ifdef _P32
4019+
max_mem = max_mem < MAX32HEAP ? max_mem : MAX32HEAP;
4020+
#endif
4021+
max_total_memory = max_mem;
40264022
}
40274023

40284024
JL_DLLEXPORT uint64_t jl_gc_get_max_memory(void)

0 commit comments

Comments
 (0)