|
From: <sv...@va...> - 2008-08-02 06:40:59
|
Author: sewardj
Date: 2008-08-02 07:41:04 +0100 (Sat, 02 Aug 2008)
New Revision: 8492
Log:
Tidy up the settings/use of MAX_FORWARD, now that the root cause of
crashes caused by overruns of arrays of forwarding pointers has been
fixed by r8478.
Modified:
branches/PTRCHECK/exp-ptrcheck/pc_list.c
Modified: branches/PTRCHECK/exp-ptrcheck/pc_list.c
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/pc_list.c 2008-08-01 16:57:17 UTC (rev 8491)
+++ branches/PTRCHECK/exp-ptrcheck/pc_list.c 2008-08-02 06:41:04 UTC (rev 8492)
@@ -121,7 +121,7 @@
// Miscellaneous
//-------------------------------------------------------------------
-#define MAX_FORWARD (8*sizeof(Addr)) // Maximum number of forward pointers
+#define MAX_FORWARD 32
static void print_Addr(Addr a)
{
@@ -866,6 +866,11 @@
// put a new node in the list for this 'a'
Int newLevel = ISList__randomLevel(o);
+ // most likely reason for this to fail is that normalizedRandom isn't
+ // working properly. It is supposed to generate numbers uniformly
+ // in the range [0.0 .. 1.0), hence with a mean of 0.5.
+ tl_assert(newLevel < MAX_FORWARD-1);
+
if (newLevel > o->maxLevel){
// New node is bigger than any previous, add the header node to the
// update vector for the new levels.
|