Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some new functions to this. Bloatware, here we come.
[simgrid.git] / src / xbt / set.c
index 8991459..80a2dc3 100644 (file)
@@ -79,7 +79,7 @@ void xbt_set_add    (xbt_set_t      set,
     xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
     xbt_dynar_set(set->dynar, elm->ID, &elm);
     DEBUG2("Insertion of key '%s' (id %d)", elm->name, elm->ID);
-    xbt_ex_free(&e);
+    xbt_ex_free(e);
   }
   
   if (found) {
@@ -146,6 +146,11 @@ xbt_set_elm_t xbt_set_get_by_id (xbt_set_t set, int id) {
   return res;
 }
 
+/** @brief Constructor */
+unsigned long xbt_set_length (const xbt_set_t set) {
+   return xbt_dynar_length(set->dynar);
+}
+
 /***
  *** Cursors
  ***/
@@ -315,7 +320,7 @@ static void search_not_found(xbt_set_t set, const char *data) {
   } CATCH(e) {
     if (e.category != not_found_error) 
       xbt_test_exception(e);
-    xbt_ex_free(&e);  
+    xbt_ex_free(e);  
   }
 }