A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update xml platform for msg-get_sender and msg-trace tests.
[simgrid.git]
/
src
/
xbt
/
swag.c
diff --git
a/src/xbt/swag.c
b/src/xbt/swag.c
index
9d6c209
..
9d69e43
100644
(file)
--- a/
src/xbt/swag.c
+++ b/
src/xbt/swag.c
@@
-1,6
+1,5
@@
-/* $Id$ */
-
-/* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */
+/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
/* 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. */
@@
-22,7
+21,7
@@
*
* Usage : xbt_swag_new(&obj.setA-&obj);
*/
*
* Usage : xbt_swag_new(&obj.setA-&obj);
*/
-xbt_swag_t xbt_swag_new(size_t offset)
+
XBT_INLINE
xbt_swag_t xbt_swag_new(size_t offset)
{
xbt_swag_t swag = xbt_new0(s_xbt_swag_t, 1);
{
xbt_swag_t swag = xbt_new0(s_xbt_swag_t, 1);
@@
-37,7
+36,7
@@
xbt_swag_t xbt_swag_new(size_t offset)
* kilkil a swag but not it's content. If you do not understand why
* xbt_swag_free should not free its content, don't use swags.
*/
* kilkil a swag but not it's content. If you do not understand why
* xbt_swag_free should not free its content, don't use swags.
*/
-void xbt_swag_free(xbt_swag_t swag)
+
XBT_INLINE
void xbt_swag_free(xbt_swag_t swag)
{
free(swag);
}
{
free(swag);
}
@@
-49,7
+48,7
@@
void xbt_swag_free(xbt_swag_t swag)
*
* Usage : xbt_swag_init(swag,&obj.setA-&obj);
*/
*
* Usage : xbt_swag_init(swag,&obj.setA-&obj);
*/
-void xbt_swag_init(xbt_swag_t swag, size_t offset)
+
XBT_INLINE
void xbt_swag_init(xbt_swag_t swag, size_t offset)
{
swag->tail = NULL;
swag->head = NULL;
{
swag->tail = NULL;
swag->head = NULL;
@@
-64,7
+63,7
@@
void xbt_swag_init(xbt_swag_t swag, size_t offset)
*
* insert \a obj in \a swag
*/
*
* insert \a obj in \a swag
*/
-void xbt_swag_insert(void *obj, xbt_swag_t swag)
+
XBT_INLINE
void xbt_swag_insert(void *obj, xbt_swag_t swag)
{
if (xbt_swag_belongs(obj, swag))
{
if (xbt_swag_belongs(obj, swag))
@@
-91,7
+90,7
@@
void xbt_swag_insert(void *obj, xbt_swag_t swag)
* insert (at the head... you probably had a very good reason to do
* that, I hope you know what you're doing) \a obj in \a swag
*/
* insert (at the head... you probably had a very good reason to do
* that, I hope you know what you're doing) \a obj in \a swag
*/
-void xbt_swag_insert_at_head(void *obj, xbt_swag_t swag)
+
XBT_INLINE
void xbt_swag_insert_at_head(void *obj, xbt_swag_t swag)
{
if (xbt_swag_belongs(obj, swag))
{
if (xbt_swag_belongs(obj, swag))
@@
-118,7
+117,7
@@
void xbt_swag_insert_at_head(void *obj, xbt_swag_t swag)
* insert (at the tail... you probably had a very good reason to do
* that, I hope you know what you're doing) \a obj in \a swag
*/
* insert (at the tail... you probably had a very good reason to do
* that, I hope you know what you're doing) \a obj in \a swag
*/
-void xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag)
+
XBT_INLINE
void xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag)
{
if (xbt_swag_belongs(obj, swag))
{
if (xbt_swag_belongs(obj, swag))
@@
-145,7
+144,7
@@
void xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag)
*
* removes \a obj from \a swag
*/
*
* removes \a obj from \a swag
*/
-void *xbt_swag_remove(void *obj, xbt_swag_t swag)
+
XBT_INLINE
void *xbt_swag_remove(void *obj, xbt_swag_t swag)
{
size_t offset = swag->offset;
{
size_t offset = swag->offset;
@@
-209,7
+208,7
@@
void *xbt_swag_extract(xbt_swag_t swag)
* \param swag a swag
* \return the number of objects in \a swag
*/
* \param swag a swag
* \return the number of objects in \a swag
*/
-int xbt_swag_size(xbt_swag_t swag)
+
XBT_INLINE
int xbt_swag_size(xbt_swag_t swag)
{
return (swag->count);
}
{
return (swag->count);
}