First-Class constraints and AddressHashTable

Raphael Collet raph at info.ucl.ac.be
Wed Jan 18 16:01:15 CET 2006


Konstantin Popov wrote:
 > yet better idea is NOT to use the emulator internal services: not
 > mentioning the SE issues, these were also optimized, trust me, for
 > specific purposes.

So you recommend to use a "real" hash table, from some general-purpose 
library?  Sounds safer indeed.

I had a slightly closer look at the usage of AddressHashTable in 
reflect_space.hh, and I am struck by the following code snippet.  It 
should *never* have worked.  It explicitly makes sure that the entry is 
overwritten (which contradicts what htAdd() does)...

   void reflected(T_WHAT k) {
     DEBUGPRINT(("TableClass::reflected -- in --"));

     int i = (int) htFind((void *) k);
     DEBUG_ASSERT((i != (int) htEmpty) && (i < 0));
     htAdd((void *) k, (void *) -i);

     DEBUGPRINT(("TableClass::reflected -- out --"));
   }

Cheers,
raph




More information about the mozart-hackers mailing list