Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ensure that the mallocator are really inactive when running MC
[simgrid.git] / src / xbt / fifo.c
index 57e0912..7a425f6 100644 (file)
@@ -450,6 +450,8 @@ XBT_INLINE int xbt_fifo_size(xbt_fifo_t f)
 /**
  * \param l a list
  * \return the head of \a l.
+ *
+ * Returns NULL if the list is empty.
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_get_first_item(xbt_fifo_t l)
 {
@@ -459,6 +461,8 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_get_first_item(xbt_fifo_t l)
 /**
  * \param l a list
  * \return the tail of \a l.
+ *
+ * Returns NULL if the list is empty.
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_get_last_item(xbt_fifo_t l)
 {
@@ -476,6 +480,8 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l)
 /**
  * \param i a bucket
  * \return the bucket that comes next
+ *
+ * Returns NULL if \a i is the tail of the list.
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_get_next_item(xbt_fifo_item_t i)
 {
@@ -495,6 +501,8 @@ xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i)
 /**
  * \param i a bucket
  * \return the bucket that is just before \a i.
+ *
+ * Returns NULL if \a i is the head of the list.
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_get_prev_item(xbt_fifo_item_t i)
 {
@@ -517,11 +525,6 @@ xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i)
  */
 void xbt_fifo_preinit(void)
 {
-  if (item_mallocator != NULL) {
-    /* Already created. I guess we want to switch to MC mode, so kill the previously created mallocator */
-    xbt_mallocator_free(item_mallocator);
-  }
-
   item_mallocator = xbt_mallocator_new(65536,
                                        fifo_item_mallocator_new_f,
                                        fifo_item_mallocator_free_f,