-/* Authors: Arnaud Legrand */
+/* $Id$ */
+
+/* Copyright (c) 2004 Arnaud Legrand. 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. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
/* Warning, this module is done to be efficient and performs tons of
cast and dirty things. So avoid using it unless you really know
#include "xbt/error.h"
#include "xbt/swag.h"
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(swag,xbt,"Swag : O(1) set library");
+
#define PREV(obj,offset) xbt_swag_getPrev(obj,offset)
#define NEXT(obj,offset) xbt_swag_getNext(obj,offset)
/*
- Usage : xbt_swag_new(&obj.setA-&obj.setA);
+ Usage : xbt_swag_new(&obj.setA-&obj);
*/
xbt_swag_t xbt_swag_new(size_t offset)
return swag;
}
+
+void xbt_swag_free(xbt_swag_t swag)
+{
+ xbt_free(swag);
+}
+
void xbt_swag_init(xbt_swag_t swag, size_t offset)
{
swag->offset = offset;
PREV(swag->head, offset) = NULL;
NEXT(obj, offset) = NULL;
}
+ (swag->count)--;
return obj;
}