Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
that's perfectly fine to not free that memory on process terminaison on Apple
[simgrid.git] / src / smpi / smpi_c99.c
1 /* Copyright (c) 2011. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include <stdlib.h>
8 #include "private.h"
9
10 static void smpi_free_static(int status, void* arg) {
11    free(arg);
12 }
13
14 void smpi_register_static(void* arg) {
15 #ifndef __APPLE__
16   // on_exit is not implemented on Apple.
17   // That's fine, the memory won't be released on UNIX process terminaison.
18   // This means that valgrind will report it as leaked (but who cares?)
19    on_exit(&smpi_free_static, arg);
20 #endif
21 }