source: rtems/cpukit/libcsupport/src/rtems_malloc.c @ e22af78

4.115
Last change on this file since e22af78 was 02733495, checked in by Sebastian Huber <sebastian.huber@…>, on 11/24/14 at 14:20:25

libcsupport: malloc_is_system_state_OK()

Move system state check to malloc_is_system_state_OK().

  • Property mode set to 100644
File size: 861 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup libcsupport
5 *
6 * @brief rtems_malloc() implementation.
7 */
8
9/*
10 * Copyright (c) 2009
11 * embedded brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * <rtems@embedded-brains.de>
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.org/license/LICENSE.
20 */
21
22#if HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#ifdef RTEMS_NEWLIB
27#include "malloc_p.h"
28
29void *rtems_heap_allocate_aligned_with_boundary(
30  size_t size,
31  uintptr_t alignment,
32  uintptr_t boundary
33)
34{
35  if ( !malloc_is_system_state_OK() ) {
36    return NULL;
37  }
38
39  malloc_deferred_frees_process();
40
41  /* FIXME: Statistics, boundary checks */
42
43  return _Protected_heap_Allocate_aligned_with_boundary(
44    RTEMS_Malloc_Heap,
45    size,
46    alignment,
47    boundary
48  );
49}
50
51#endif
Note: See TracBrowser for help on using the repository browser.