source: rtems/cpukit/libcsupport/src/rtems_malloc.c @ 46689a1e

4.115
Last change on this file since 46689a1e was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 954 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
29#include <rtems/score/sysstate.h>
30
31void *rtems_heap_allocate_aligned_with_boundary(
32  size_t size,
33  uintptr_t alignment,
34  uintptr_t boundary
35)
36{
37  if (
38    _System_state_Is_up( _System_state_Get() )
39      && !malloc_is_system_state_OK()
40  ) {
41    return NULL;
42  }
43
44  malloc_deferred_frees_process();
45
46  /* FIXME: Statistics, boundary checks */
47
48  return _Protected_heap_Allocate_aligned_with_boundary(
49    RTEMS_Malloc_Heap,
50    size,
51    alignment,
52    boundary
53  );
54}
55
56#endif
Note: See TracBrowser for help on using the repository browser.