5
Last change
on this file since 80cf60e was
80cf60e,
checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/20 at 07:48:32
|
Canonicalize config.h include
Use the following variant which was already used by most source files:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
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.org/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifdef HAVE_CONFIG_H |
---|
23 | #include "config.h" |
---|
24 | #endif |
---|
25 | |
---|
26 | #include "malloc_p.h" |
---|
27 | |
---|
28 | void *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 | |
---|
42 | void *rtems_heap_greedy_allocate_all_except_largest( |
---|
43 | uintptr_t *allocatable_size |
---|
44 | ) |
---|
45 | { |
---|
46 | void *opaque; |
---|
47 | |
---|
48 | _RTEMS_Lock_allocator(); |
---|
49 | opaque = _Heap_Greedy_allocate_all_except_largest( |
---|
50 | RTEMS_Malloc_Heap, |
---|
51 | allocatable_size |
---|
52 | ); |
---|
53 | _RTEMS_Unlock_allocator(); |
---|
54 | |
---|
55 | return opaque; |
---|
56 | } |
---|
57 | |
---|
58 | void rtems_heap_greedy_free( void *opaque ) |
---|
59 | { |
---|
60 | _RTEMS_Lock_allocator(); |
---|
61 | _Heap_Greedy_free( RTEMS_Malloc_Heap, opaque ); |
---|
62 | _RTEMS_Unlock_allocator(); |
---|
63 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.