X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/149c63f36e15b8500b1e826bda5138318ff7ba2b..b6d29644d566a866a7cec0ab4c601700fdb47020:/src/xbt/mmalloc/swag.c diff --git a/src/xbt/mmalloc/swag.c b/src/xbt/mmalloc/swag.c index 23211e9001..eff83683da 100644 --- a/src/xbt/mmalloc/swag.c +++ b/src/xbt/mmalloc/swag.c @@ -1,5 +1,4 @@ -/* Copyright (c) 2004-2020. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -11,7 +10,7 @@ /* This type should be added to a type that is to be used in such a swag */ #include "swag.h" -#include "xbt/asserts.h" +#include "mmprivate.h" // mmalloc_assert typedef s_xbt_swag_hookup_t *xbt_swag_hookup_t; typedef struct xbt_swag* xbt_swag_t; @@ -23,7 +22,7 @@ typedef const struct xbt_swag* const_xbt_swag_t; static inline void *xbt_swag_getFirst(const_xbt_swag_t swag) { - return (swag->head); + return swag->head; } /* @@ -63,11 +62,12 @@ static inline void xbt_swag_init(xbt_swag_t swag, size_t offset) */ static inline void xbt_swag_insert(void *obj, xbt_swag_t swag) { - xbt_assert(!xbt_swag_belongs(obj, swag) || swag->tail, - "This object belongs to an empty swag! Did you correctly initialize the object's hookup?"); + + mmalloc_assert(!xbt_swag_belongs(obj, swag) || swag->tail, + "This object belongs to an empty swag! Did you correctly initialize the object's hookup?"); if (!swag->head) { - xbt_assert(!(swag->tail), "Inconsistent swag."); + mmalloc_assert(!(swag->tail), "Inconsistent swag."); swag->head = obj; swag->tail = obj; swag->count++; @@ -124,5 +124,5 @@ static inline void *xbt_swag_remove(void *obj, xbt_swag_t swag) */ static inline int xbt_swag_size(const_xbt_swag_t swag) { - return (swag->count); + return swag->count; }