libretro: direct fb access requires duping support
[pcsx_rearmed.git] / deps / lightrec / memmanager.h
CommitLineData
98fa08a5 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
d16005f8 2/*
98fa08a5 3 * Copyright (C) 2019-2021 Paul Cercueil <paul@crapouillou.net>
d16005f8
PC
4 */
5
6#ifndef __MEMMANAGER_H__
7#define __MEMMANAGER_H__
8
9#include "lightrec.h"
10
98fa08a5
PC
11enum mem_type {
12 MEM_FOR_CODE,
13 MEM_FOR_MIPS_CODE,
14 MEM_FOR_IR,
15 MEM_FOR_LIGHTREC,
16 MEM_TYPE_END,
17};
18
d16005f8
PC
19void * lightrec_malloc(struct lightrec_state *state,
20 enum mem_type type, unsigned int len);
21void * lightrec_calloc(struct lightrec_state *state,
22 enum mem_type type, unsigned int len);
23void lightrec_free(struct lightrec_state *state,
24 enum mem_type type, unsigned int len, void *ptr);
25
26void lightrec_register(enum mem_type type, unsigned int len);
27void lightrec_unregister(enum mem_type type, unsigned int len);
28
98fa08a5
PC
29unsigned int lightrec_get_mem_usage(enum mem_type type);
30unsigned int lightrec_get_total_mem_usage(void);
31float lightrec_get_average_ipi(void);
32
d16005f8 33#endif /* __MEMMANAGER_H__ */