aboutsummaryrefslogtreecommitdiff
path: root/src/std/mem.c
blob: 8658781a3d9bd49bdaa2be775b30ae1a0ff32e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "../../include/std/mem.h"
#include <string.h>
#include <unistd.h>

void am_memcpy(void *dest, const void *src, usize size) {
    memcpy(dest, src, size);
}

int am_memcmp(const void *lhs, const void *rhs, usize size) {
    return memcmp(lhs, rhs, size);
}

bool am_memeql(const void *lhs, const void *rhs, usize size) {
    return am_memcmp(lhs, rhs, size) == 0;
}

void am_memset(void *dest, int value, usize size) {
    memset(dest, value, size);
}

long am_pagesize(void) {
    return sysconf(_SC_PAGESIZE);
}