Skip to content

Commit

Permalink
Fix GC
Browse files Browse the repository at this point in the history
  • Loading branch information
AHGIJMKLKKZNPJKQR committed Jan 20, 2025
1 parent 26b841a commit 93fe25c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib_cacophony/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void objectTraversal::traverseObjects(ll *object, bool is_stack_frame) {
if(LOG_GC) {
std::cerr << "traversing " << object << ", is stack " << is_stack_frame << std::endl;
}
if(!is_stack_frame) markVisited(object);
markVisited(object);

int outline_offset = is_stack_frame ? 1 : -1;
ll *outline = reinterpret_cast<ll*>(*(object + outline_offset));
Expand All @@ -187,7 +187,7 @@ void objectTraversal::traverseObjects(ll *object, bool is_stack_frame) {
ll *referenced_object = *reference;

bool next_is_stack_frame = is_stack_frame && offset == 0;
if(next_is_stack_frame || !isVisited(referenced_object)) {
if(!isVisited(referenced_object)) {
traverseObjects(referenced_object, next_is_stack_frame);
}
}
Expand Down Expand Up @@ -228,4 +228,4 @@ static ll** allocMemory(ll *outline) {
}
*ptr = outline;
return ptr + 1;
}
}
2 changes: 1 addition & 1 deletion lib_cacophony/gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ extern "C" {
}
}

#endif /* GC_LIB_H */
#endif /* GC_LIB_H */
2 changes: 1 addition & 1 deletion lib_cacophony/gc/gcimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ static void runGc(ll *rbp);

static ll** allocMemory(ll *outline);

#endif /* GC_IMPL_H */
#endif /* GC_IMPL_H */

0 comments on commit 93fe25c

Please sign in to comment.