source: rtems/cpukit/libcsupport/src/malloc_deferred.c @ 9b4422a2

4.11
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  Process free requests deferred because they were from ISR
3 *  or other critical section.
4 *
5 *  COPYRIGHT (c) 1989-2007.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 */
12
13#if HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#ifdef RTEMS_NEWLIB
18#include <stdlib.h>
19#include <errno.h>
20
21#include "malloc_p.h"
22
23rtems_chain_control RTEMS_Malloc_GC_list;
24
25bool malloc_is_system_state_OK(void)
26{
27  if ( _Thread_Dispatch_in_critical_section() )
28    return false;
29
30  if ( _ISR_Nest_level > 0 )
31    return false;
32
33  return true;
34}
35
36void malloc_deferred_frees_initialize(void)
37{
38  rtems_chain_initialize_empty(&RTEMS_Malloc_GC_list);
39}
40
41void malloc_deferred_frees_process(void)
42{
43  rtems_chain_node  *to_be_freed;
44
45  /*
46   *  If some free's have been deferred, then do them now.
47   */
48  while ((to_be_freed = rtems_chain_get(&RTEMS_Malloc_GC_list)) != NULL)
49    free(to_be_freed);
50}
51
52void malloc_deferred_free(
53  void *pointer
54)
55{
56  rtems_chain_append(&RTEMS_Malloc_GC_list, (rtems_chain_node *)pointer);
57}
58#endif
Note: See TracBrowser for help on using the repository browser.