1 /* Copyright (c) 2011-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
10 typedef struct s_smpi_static {
12 void_f_pvoid_t free_fn;
15 static xbt_dynar_t registered_static_stack = NULL;
17 void smpi_register_static(void* arg, void_f_pvoid_t free_fn)
19 s_smpi_static_t elm = { arg, free_fn };
20 if (!registered_static_stack)
21 registered_static_stack = xbt_dynar_new(sizeof(s_smpi_static_t), NULL);
22 xbt_dynar_push_as(registered_static_stack, s_smpi_static_t, elm);
25 void smpi_free_static(void)
27 while (!xbt_dynar_is_empty(registered_static_stack)) {
29 xbt_dynar_pop_as(registered_static_stack, s_smpi_static_t);
32 xbt_dynar_free(®istered_static_stack);