minor fix
[cdsspec-compiler.git] / benchmark / cliffc-hashtable / cliffc_hashtable.h
index 756cbb964dc370eebef555341903d0a29afadbca..c3cea0d20fef1ae5130a603201508c7acfedc279 100644 (file)
 #include <model-assert.h>
 #endif
 
+#include <spec_lib.h>
+#include <stdlib.h>
+#include <cdsannotate.h>
+#include <specannotation.h>
+#include <model_memory.h>
+
 using namespace std;
 
 /**
@@ -124,7 +130,7 @@ class cliffc_hashtable {
                                        *id2 = (id_tag_t*) ptr2;
                                if (id1 == NULL || id2 == NULL)
                                        return false;
-                               return *id1 == *id2;
+                               return (*id1).tag == (*id2).tag;
                        }
 
                        @DefineFunc:
@@ -163,7 +169,9 @@ class cliffc_hashtable {
                                ReplaceIfMatch(COND_ReplaceIfMatchSucc)
                        }
                @Happens_before:
-                       Write_interface -> Read_interface
+                       //Write_interface -> Read_interface
+                       Put->Get
+                       Put->Put
                @End
        */
 
@@ -391,6 +399,12 @@ friend class CHM;
                // Should initialize the CHM for the construction of the table
                // For other CHM in kvs_data, they should be initialzed in resize()
                // because the size is determined dynamically
+               /**
+                       @Begin
+                       @Entry_point
+                       @End
+               */
+
                kvs_data *kvs = new kvs_data(init_size);
                void *chm = (void*) new CHM(0);
                kvs->_data[0].store(chm, memory_order_relaxed);
@@ -436,7 +450,7 @@ friend class CHM;
        }
 
        /**
-               @Begin
+//             @Begin
                @Interface: PutIfAbsent
                @Commit_point_set:
                        Write_Success_Point | PutIfAbsent_Fail_Point
@@ -457,7 +471,7 @@ friend class CHM;
        }
 
        /**
-               @Begin
+//             @Begin
                @Interface: RemoveAny
                @Commit_point_set: Write_Success_Point
                @ID: getKeyTag(key)
@@ -473,7 +487,7 @@ friend class CHM;
        }
 
        /**
-               @Begin
+//             @Begin
                @Interface: RemoveIfMatch
                @Commit_point_set:
                        Write_Success_Point | RemoveIfMatch_Fail_Point
@@ -496,7 +510,7 @@ friend class CHM;
        }
 
        /**
-               @Begin
+//             @Begin
                @Interface: ReplaceAny
                @Commit_point_set:
                        Write_Success_Point
@@ -512,7 +526,7 @@ friend class CHM;
        }
 
        /**
-               @Begin
+//             @Begin
                @Interface: ReplaceIfMatch
                @Commit_point_set:
                        Write_Success_Point | ReplaceIfMatch_Fail_Point