forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalloc.c
More file actions
61 lines (51 loc) · 1.17 KB
/
alloc.c
File metadata and controls
61 lines (51 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2018 Intel Corporation. All rights reserved.
//
// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
// Liam Girdwood <liam.r.girdwood@linux.intel.com>
// Keyon Jie <yang.jie@linux.intel.com>
// Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <malloc.h>
#include <rtos/alloc.h>
#include <sof/lib/mm_heap.h>
/* testbench mem alloc definition */
void *rmalloc_align(uint32_t flags, size_t bytes, uint32_t alignment)
{
return malloc(bytes);
}
void *rmalloc(uint32_t flags, size_t bytes)
{
return malloc(bytes);
}
void *rzalloc(uint32_t flags, size_t bytes)
{
return calloc(bytes, 1);
}
void rfree(void *ptr)
{
free(ptr);
}
void *rballoc_align(uint32_t flags, size_t bytes,
uint32_t alignment)
{
return malloc(bytes);
}
void *rbrealloc_align(void *ptr, uint32_t flags, size_t bytes,
size_t old_bytes, uint32_t alignment)
{
return realloc(ptr, bytes);
}
void heap_trace(struct mm_heap *heap, int size)
{
#if MALLOC_DEBUG
malloc_info(0, stdout);
#endif
}
void heap_trace_all(int force)
{
heap_trace(NULL, 0);
}