diff --git a/src/libexpr/gc.cc b/src/libexpr/gc.cc index 58107690d..1a56ac324 100644 --- a/src/libexpr/gc.cc +++ b/src/libexpr/gc.cc @@ -12,14 +12,14 @@ GC::GC() nextSize = std::max((size_t) 2, parseSize(getEnv("GC_INITIAL_HEAP_SIZE", "131072")) / WORD_SIZE); // FIXME: placement new - frontSentinel = (Ptr *) malloc(sizeof(Ptr)); - backSentinel = (Ptr *) malloc(sizeof(Ptr)); + frontPtrSentinel = (Ptr *) malloc(sizeof(Ptr)); + backPtrSentinel = (Ptr *) malloc(sizeof(Ptr)); - frontSentinel->prev = nullptr; - frontSentinel->next = backSentinel; + frontPtrSentinel->prev = nullptr; + frontPtrSentinel->next = backPtrSentinel; - backSentinel->prev = frontSentinel; - backSentinel->next = nullptr; + backPtrSentinel->prev = frontPtrSentinel; + backPtrSentinel->next = nullptr; frontRootSentinel = (Root *) malloc(sizeof(Root)); backRootSentinel = (Root *) malloc(sizeof(Root)); @@ -47,7 +47,7 @@ GC::~GC() debug("allocated %d bytes in total", totalSize * WORD_SIZE); size_t n = 0; - for (Ptr * p = frontSentinel->next; p != backSentinel; p = p->next) + for (Ptr * p = frontPtrSentinel->next; p != backPtrSentinel; p = p->next) n++; if (n) warn("%d GC root pointers still exist on exit", n); @@ -58,8 +58,8 @@ GC::~GC() if (n) warn("%d GC root objects still exist on exit", n); - assert(!frontSentinel->prev); - assert(!backSentinel->next); + assert(!frontPtrSentinel->prev); + assert(!backPtrSentinel->next); assert(!frontRootSentinel->prev); assert(!backRootSentinel->next); } @@ -227,7 +227,7 @@ void GC::gc() processStack(); } - for (Ptr * p = frontSentinel->next; p != backSentinel; p = p->next) { + for (Ptr * p = frontPtrSentinel->next; p != backPtrSentinel; p = p->next) { if (!p->value) continue; stack.push(p->value); processStack(); diff --git a/src/libexpr/gc.hh b/src/libexpr/gc.hh index f8be832eb..5a62fb052 100644 --- a/src/libexpr/gc.hh +++ b/src/libexpr/gc.hh @@ -136,8 +136,8 @@ struct GC private: - Ptr * frontSentinel; - Ptr * backSentinel; + Ptr * frontPtrSentinel; + Ptr * backPtrSentinel; Root * frontRootSentinel; Root * backRootSentinel; @@ -295,7 +295,7 @@ private: void link() { - prev = (Ptr *) gc.frontSentinel; + prev = (Ptr *) gc.frontPtrSentinel; next = prev->next; next->prev = this; prev->next = this;