Fix incorrect comment in lgc.h

The comment gave an incorrect (reversed) version of the invariant, which
could be confusing for people who haven't read the full description in
lgc.cpp.
This commit is contained in:
Arseny Kapoulkine 2024-06-07 09:36:29 -07:00
parent 8a64cb8b73
commit 2c3fac891d

View file

@ -23,11 +23,10 @@
#define GCSsweep 4 #define GCSsweep 4
/* /*
** macro to tell when main invariant (white objects cannot point to black ** The main invariant of the garbage collector, while marking objects,
** ones) must be kept. During a collection, the sweep ** is that a black object can never point to a white one. This invariant
** phase may break the invariant, as objects turned white may point to ** is not being enforced during a sweep phase, and is restored when sweep
** still-black objects. The invariant is restored when sweep ends and ** ends.
** all objects are white again.
*/ */
#define keepinvariant(g) ((g)->gcstate == GCSpropagate || (g)->gcstate == GCSpropagateagain || (g)->gcstate == GCSatomic) #define keepinvariant(g) ((g)->gcstate == GCSpropagate || (g)->gcstate == GCSpropagateagain || (g)->gcstate == GCSatomic)