Welcome to mirror list, hosted at ThFree Co, Russian Federation.

memmgr.h « furi « core - github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7c8a3fe900cbd686d5750f0f6e1525f9af905c39 (plain)
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
/**
 * @file memmgr.h
 * Furi: memory managment API and glue
 */

#pragma once

#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "check.h"

#ifdef __cplusplus
extern "C" {
#endif

// define for test case "link against furi memmgr"
#define FURI_MEMMGR_GUARD 1

/** Get free heap size
 *
 * @return     free heap size in bytes
 */
size_t memmgr_get_free_heap(void);

/** Get heap watermark
 *
 * @return     minimum heap in bytes
 */
size_t memmgr_get_minimum_free_heap(void);

/** Allocate memory from heap
 *
 * @note       performs memset with 0, will crash system if not enough memory
 *
 * @param[in]  size  bytes to allocate
 *
 * @return     pointer to allocated memory
 */
void* furi_alloc(size_t size);

#ifdef __cplusplus
}
#endif