mmtk-core
mmtk-core copied to clipboard
Confusing name: scan_thread_roots
In the Scanning trait, there are two methods:
-
scan_thread_rootsscans all roots in all threads. -
scan_thread_rootscans all roots in one thread.
The names are confusing because the plural is on the word "root", while the word "thread" is always singular.
And although "thread" is a noun, it can be an attributive noun. So "thread roots" can refer to any root as long as it is from any thread. This makes scan_thread_roots ambiguous: it may mean (a) "scan one thread for its roots", and (b) "scan all 'thread roots' which may be on any thread".
Suggested change:
-
scan_all_threads_for_roots -
scan_thread_for_roots
or
-
scan_all_threads -
scan_thread
or
-
scan_roots_in_all_threads -
scan_roots_in_thread
or
-
scan_roots_all_threads -
scan_roots_one_thread
I like the third option best (scan_roots_in_all_threads, scan_roots_in_thread).