Skip to content

Commit d9cccf6

Browse files
committed
don't forget to reset gc_num.allocd
1 parent 887384f commit d9cccf6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/gc.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3740,16 +3740,19 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
37403740
#endif
37413741

37423742
_report_gc_finished(pause, gc_num.freed, sweep_full, recollect, live_bytes);
3743-
uint64_t max_memory = last_live_bytes + gc_num.allocd;
3744-
if (max_memory > gc_num.max_memory) {
3745-
gc_num.max_memory = max_memory;
3746-
}
3743+
37473744
gc_final_pause_end(gc_start_time, gc_end_time);
37483745
gc_time_sweep_pause(gc_end_time, gc_num.allocd, live_bytes,
37493746
gc_num.freed, sweep_full);
37503747
gc_num.full_sweep += sweep_full;
3748+
uint64_t max_memory = last_live_bytes + gc_num.allocd;
3749+
if (max_memory > gc_num.max_memory) {
3750+
gc_num.max_memory = max_memory;
3751+
}
3752+
3753+
gc_num.allocd = 0;
37513754
last_live_bytes = live_bytes;
3752-
live_bytes += -gc_num.freed + gc_num.allocd;
3755+
live_bytes += -gc_num.freed + gc_num.since_sweep;
37533756

37543757
gc_time_summary(sweep_full, t_start, gc_end_time, gc_num.freed,
37553758
live_bytes, gc_num.interval, pause,

src/staticdata.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ External links:
7171
*/
7272
#include <stdlib.h>
7373
#include <string.h>
74+
#include <stdbool.h>
7475
#include <stdio.h> // printf
7576
#include <inttypes.h> // PRIxPTR
7677

0 commit comments

Comments
 (0)