Merge pull request #367 from kalvdans/zero-allocations

Add initialization of seginfo sorted and trigger_ephemerons fields
original commit: d677c0d03b734b3cf5166f2cd6b97effd64667ec
This commit is contained in:
R. Kent Dybvig 2018-12-05 15:32:37 -08:00 committed by GitHub
commit 03a33fb4fc
2 changed files with 4 additions and 2 deletions

2
LOG
View File

@ -1025,3 +1025,5 @@
where the cp register copy in the thread context could be changed
in the callable prep before S_call_help gets it
cpnanopass.ss, x86_64.ss, x86.ss, foreign2.c, foreign.ms
- added initialization of seginfo sorted and trigger_ephemerons fields.
segment.c

View File

@ -228,7 +228,9 @@ static void initialize_seginfo(seginfo *si, ISPC s, IGEN g) {
si->space = s;
si->generation = g;
si->sorted = 0;
si->min_dirty_byte = 0xff;
si->trigger_ephemerons = NULL;
for (d = 0; d < cards_per_segment; d += sizeof(ptr)) {
iptr *dp = (iptr *)(si->dirty_bytes + d);
/* fill sizeof(iptr) bytes at a time with 0xff */
@ -261,7 +263,6 @@ iptr S_find_segments(s, g, n) ISPC s; IGEN g; iptr n; {
chunk->nused_segs += 1;
initialize_seginfo(si, s, g);
si->sorted = 0;
si->next = S_G.occupied_segments[s][g];
S_G.occupied_segments[s][g] = si;
S_G.number_of_empty_segments -= 1;
@ -300,7 +301,6 @@ iptr S_find_segments(s, g, n) ISPC s; IGEN g; iptr n; {
S_G.occupied_segments[s][g] = si;
for (j = n, nextsi = si; j > 0; j -= 1, nextsi = nextsi->next) {
initialize_seginfo(nextsi, s, g);
nextsi->sorted = 0;
}
S_G.number_of_empty_segments -= n;
return si->number;