Hi.

 

I’m trying to solve a problem with the Reflect package, in particular its “Reflect.spaceReflect” function.  In 1.2.5 it worked fine.  However, in 1.3.1 it runs forever and ends up swamping virtual memory.

 

I’ve tracked down the problem to the “htAdd” member function of the “AddressHashTable” class, in the file “platform/emulator/hashtbl.cc”.

 

Here’s a snippet:

  DebugCode(int step = 1;);

 

  //

  while (1) {

    if (table[key].getCnt() < pass) {

      // certainly not there;

      table[key].setKey(k);

      table[key].setValue(val);

      table[key].setCnt(pass);

      counter++;

      break;

    } else if (table[key].getKey() == k) {

      // already there;

      // DENYS: this assertion is ifdef’ed out because it turns out

      // that when building the opcodeTable, there are instructions that

      // share the same jump label.

# if !defined(THREADED)

      Assert(table[key].getValue() == val);

#endif

      break;

    } else {

      // next hop:

      if (ikey == 0) {

            ikey = ((m << slsBits) >> rsBits) | 0x1;

------ end snippet -----

 

The problem is with the “else if” in the while loop.  If a program tries to change the value that is stored under a hash key “k” (which is hashed to the value “key” in the function) to “val”, as in handled by the “else if”, this simply fails (i.e. nothing is actually done).

 

Is there a problem with changing the value stored under a key in an AddressHashTable?  If so, perhaps I’ll use SGI’s “hashmap” extension to the STL for the Reflect module.

 

Thanks.

 

-- Harmon

_________________________________________________________________________________
mozart-hackers mailing list                           
[email protected]      
http://www.mozart-oz.org/mailman/listinfo/mozart-hackers

Reply via email to