Scalability fix for Helgrind: reduce the size of ScalarTS (scalar
timestamps) from 16 to 8 bytes.  This halves the size of vector
timestamps and reduces the amount of memory needed to run programs
that have many threads and/or many synchronisation events.

The tradeoff is that Helgrind must abort the run if the program
creates more than 2^20 (1.0e+6) threads or performs more than 2^44
(1.76e+13) synchronisation events.  Neither of these seem like a
significant limitation in practice.  It's easy to argue that a limit
of 2^44 synch events would take at a minimum, several CPU months on a
very fast machine.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11570 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/helgrind/hg_lock_n_thread.h b/helgrind/hg_lock_n_thread.h
index dc983a5..e4f782a 100644
--- a/helgrind/hg_lock_n_thread.h
+++ b/helgrind/hg_lock_n_thread.h
@@ -54,8 +54,13 @@
 /* Synchronisation Objects, exported abstractly by libhb. */
 typedef  struct _SO  SO;
 
-/* Thr, libhb's private thread record, exported abstractly */
+/* Thr, libhb's private thread record, exported abstractly.  Thr's are
+   allocated and never deallocated (simply leaked).  Also ThrID, which
+   is a small integer which uniquely identifies a Thr and which is
+   used in ScalarTS because it is smaller than a Thr*.  There is a 1-1
+   mapping between Thr's and ThrIDs. */
 typedef  struct _Thr  Thr;
+typedef  UInt         ThrID;
 
 
 /* Stores information about a thread.  Addresses of these also serve