Skip to content

Commit

Permalink
NFC: clenaup jl_gc_set_max_memory a bit (#55110)
Browse files Browse the repository at this point in the history
This code is quite contrived. Let's simplify it a bit.
  • Loading branch information
d-netto authored Jul 12, 2024
1 parent aba6766 commit 6cb71e7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4015,14 +4015,10 @@ void jl_gc_init(void)

JL_DLLEXPORT void jl_gc_set_max_memory(uint64_t max_mem)
{
if (max_mem > 0
&& max_mem < (uint64_t)1 << (sizeof(memsize_t) * 8 - 1)) {
#ifdef _P64
max_total_memory = max_mem;
#else
max_total_memory = max_mem < MAX32HEAP ? max_mem : MAX32HEAP;
#endif
}
#ifdef _P32
max_mem = max_mem < MAX32HEAP ? max_mem : MAX32HEAP;
#endif
max_total_memory = max_mem;
}

JL_DLLEXPORT uint64_t jl_gc_get_max_memory(void)
Expand Down

0 comments on commit 6cb71e7

Please sign in to comment.