Better tests for gray lists

Test uses an extra bit in 'marked' to mark all elements in gray lists
and then check against elements colored gray.
This commit is contained in:
Roberto Ierusalimschy
2020-08-07 14:45:20 -03:00
parent 7c3cb71fa4
commit f13dc59416
3 changed files with 37 additions and 10 deletions

5
lgc.h
View File

@@ -69,13 +69,16 @@
/*
** Layout for bit use in 'marked' field. First three bits are
** used for object "age" in generational mode.
** used for object "age" in generational mode. Last bit is used
** by tests.
*/
#define WHITE0BIT 3 /* object is white (type 0) */
#define WHITE1BIT 4 /* object is white (type 1) */
#define BLACKBIT 5 /* object is black */
#define FINALIZEDBIT 6 /* object has been marked for finalization */
#define TESTBIT 7
#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)