hollyhock
Loading...
Searching...
No Matches
mem.h
Go to the documentation of this file.
1
8#pragma once
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#define __UCONCAT(a, b) #a b
15#define _UCONCAT(a, b) __UCONCAT(a, b)
16#define UCONCAT(b) _UCONCAT(__USER_LABEL_PREFIX__, b)
17
18#include <stdint.h>
19#include <stddef.h>
20
26extern void (*Mem_Free)(void *ptr);
27
28extern void *(*_FP_Mem_Malloc)(size_t size) __asm__ (UCONCAT("Mem_Malloc")) __attribute__((alloc_size(1), warn_unused_result));
29
38static void *Mem_Malloc(size_t size) __asm__ (UCONCAT("Mem_Malloc_Wrapper")) __attribute__((malloc, alloc_size(1), assume_aligned(4), unused, warn_unused_result));
39void *Mem_Malloc(size_t size) {
40 return _FP_Mem_Malloc(size);
41}
42
54extern void *(*Mem_Memcpy)(void *destination, const void *source, size_t num)
55#ifndef __clang__
56__attribute__((access(read_only, 2, 3), access(write_only, 1, 3)))
57#endif
58;
59
72extern void *(*Mem_Memset)(void *ptr, int value, size_t num)
73#ifndef __clang__
74__attribute__((access(write_only, 1, 3)))
75#endif
76;
77
78#ifdef __cplusplus
79}
80#endif
void(* Mem_Free)(void *ptr)