Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This variable is used only with contexts, not with pthreads
[simgrid.git] / src / xbt / swag.c
index ec8e4c7..d20cd5e 100644 (file)
@@ -12,7 +12,7 @@
 /* This type should be added to a type that is to be used in such a swag */
 
 #include "xbt/sysdep.h"
-#include "xbt/error.h"
+#include "xbt/log.h"
 #include "xbt/swag.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(swag,xbt,"Swag : O(1) set library");
@@ -31,7 +31,10 @@ xbt_swag_t xbt_swag_new(size_t offset)
 {
   xbt_swag_t swag = xbt_new0(s_xbt_swag_t, 1);
 
+  swag->tail = NULL;
+  swag->head = NULL;
   swag->offset = offset;
+  swag->count = 0;
 
   return swag;
 }
@@ -56,7 +59,10 @@ void xbt_swag_free(xbt_swag_t swag)
  */
 void xbt_swag_init(xbt_swag_t swag, size_t offset)
 {
+  swag->tail = NULL;
+  swag->head = NULL;
   swag->offset = offset;
+  swag->count = 0;
 }