source: rtems/cpukit/libcsupport/src/rtems_heap_greedy.c @ 3750995

4.115
Last change on this file since 3750995 was 3750995, checked in by Alex Ivanov <alexivanov97@…>, on 12/10/12 at 19:51:23

libcsupport: Doxygen enhancement task #5

http://www.google-melange.com/gci/task/view/google/gci2012/7992211

  • Property mode set to 100644
File size: 935 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief Greedy Allocate that Empties the Heap
5 *  @ingroup MallocSupport
6 */
7
8/*
9 * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
10 *
11 *  embedded brains GmbH
12 *  Obere Lagerstr. 30
13 *  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.com/license/LICENSE.
20 */
21
22#if HAVE_CONFIG_H
23  #include "config.h"
24#endif
25
26#include "malloc_p.h"
27
28void *rtems_heap_greedy_allocate(
29  const uintptr_t *block_sizes,
30  size_t block_count
31)
32{
33  void *opaque;
34
35  _RTEMS_Lock_allocator();
36  opaque = _Heap_Greedy_allocate( RTEMS_Malloc_Heap, block_sizes, block_count );
37  _RTEMS_Unlock_allocator();
38
39  return opaque;
40}
41
42void rtems_heap_greedy_free( void *opaque )
43{
44  _RTEMS_Lock_allocator();
45  _Heap_Greedy_free( RTEMS_Malloc_Heap, opaque );
46  _RTEMS_Unlock_allocator();
47}
Note: See TracBrowser for help on using the repository browser.