2018-08-29 10:23:12 +05:30
|
|
|
#ifndef MEMORY_H
|
|
|
|
#define MEMORY_H
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2019-07-06 07:29:44 +05:30
|
|
|
#ifdef __linux__
|
|
|
|
#define HAVE_COMPATIBLE_MREMAP
|
|
|
|
#endif
|
|
|
|
|
2018-10-20 06:59:40 +05:30
|
|
|
int get_metadata_key(void);
|
|
|
|
|
2018-08-29 10:23:12 +05:30
|
|
|
void *memory_map(size_t size);
|
2018-08-29 22:34:52 +05:30
|
|
|
int memory_map_fixed(void *ptr, size_t size);
|
2018-08-29 10:23:12 +05:30
|
|
|
int memory_unmap(void *ptr, size_t size);
|
2018-08-29 20:22:10 +05:30
|
|
|
int memory_protect_ro(void *ptr, size_t size);
|
2018-10-20 06:59:40 +05:30
|
|
|
int memory_protect_rw(void *ptr, size_t size);
|
|
|
|
int memory_protect_rw_metadata(void *ptr, size_t size);
|
2019-07-06 07:29:44 +05:30
|
|
|
#ifdef HAVE_COMPATIBLE_MREMAP
|
2018-10-06 20:10:55 +05:30
|
|
|
int memory_remap(void *old, size_t old_size, size_t new_size);
|
2018-08-29 20:13:54 +05:30
|
|
|
int memory_remap_fixed(void *old, size_t old_size, void *new, size_t new_size);
|
2019-07-06 07:29:44 +05:30
|
|
|
#endif
|
2021-03-22 21:54:26 +05:30
|
|
|
int memory_purge(void *ptr, size_t size);
|
2018-12-11 23:07:37 +05:30
|
|
|
void memory_set_name(void *ptr, size_t size, const char *name);
|
2018-08-29 10:23:12 +05:30
|
|
|
|
|
|
|
#endif
|