Back to index

glibc  2.9
set-freeres.c File Reference
#include <atomic.h>
#include <stdlib.h>
#include <set-hooks.h>
#include <libc-internal.h>

Go to the source code of this file.


 DEFINE_HOOK (__libc_subfreeres,(void))
 symbol_set_define (__libc_freeres_ptrs)
void __libc_freeres_fn_section __libc_freeres (void)

Function Documentation

Definition at line 33 of file set-freeres.c.

  /* This function might be called from different places.  So better
     protect for multiple executions since these are fatal.  */
  static long int already_called;

  if (! atomic_compare_and_exchange_bool_acq (&already_called, 1, 0))
      void * const *p;

      _IO_cleanup ();

      RUN_HOOK (__libc_subfreeres, ());

      for (p = symbol_set_first_element (__libc_freeres_ptrs);
          ! symbol_set_end_p (__libc_freeres_ptrs, p); ++p)
       free (*p);

Here is the call graph for this function:

DEFINE_HOOK ( __libc_subfreeres  ,
symbol_set_define ( __libc_freeres_ptrs  )