add a thp-based huge page alloc fallback
[pcsx_rearmed.git] / deps / lightrec / memmanager.h
... / ...
CommitLineData
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2019-2021 Paul Cercueil <paul@crapouillou.net>
4 */
5
6#ifndef __MEMMANAGER_H__
7#define __MEMMANAGER_H__
8
9#include "lightrec.h"
10
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
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
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
33#endif /* __MEMMANAGER_H__ */