kiba-engine
kiba
platform
linux
memory.c
Go to the documentation of this file.
1
6
#include <
kiba/platform/memory.h
>
7
8
#include <stdlib.h>
9
#include <string.h>
10
11
void
*
platform_memory_allocate
(usize size) {
return
malloc(size); }
12
13
void
platform_memory_free
(
void
*mem, usize size) {
14
UNUSED
(size);
15
free(mem);
16
}
17
18
void
*
platform_memory_set
(
void
*mem, u8
byte
, usize size) {
return
memset(mem,
byte
, size); }
19
20
void
*
platform_memory_copy
(
void
*dst,
const
void
*src, usize size) {
return
memcpy(dst, src, size); }
UNUSED
#define UNUSED(x)
Mark parameter as unused.
Definition:
defines.h:21
platform_memory_set
void * platform_memory_set(void *mem, u8 byte, usize size)
Set memory block to a specific byte value.
Definition:
memory.c:18
platform_memory_allocate
void * platform_memory_allocate(usize size)
Allocate memory.
Definition:
memory.c:11
platform_memory_free
void platform_memory_free(void *mem, usize size)
Free memory.
Definition:
memory.c:13
platform_memory_copy
void * platform_memory_copy(void *dst, const void *src, usize size)
Copy memory.
Definition:
memory.c:20
memory.h
Interface to access platform specific memory functionality.
Generated by
1.9.1