puzzlebox
Loading...
Searching...
No Matches
pb-mem.h
1#pragma once
2
3#include "pb-types.h"
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
30void * pb_malloc(size_t sz);
35void pb_free(void * ptr);
45void * pb_realloc(void * ptr, size_t sz);
46
56void * pb_memcpy(void * dest, const void * src, size_t sz);
67int pb_memcmp(const void * a, const void * b, size_t sz);
68
70
71#ifdef __cplusplus
72}
73#endif
int pb_memcmp(const void *a, const void *b, size_t sz)
compare two memory regions
Definition pb-mem.c:25
void pb_free(void *ptr)
Free a chunk of memory previously allocated with pb_malloc()
Definition pb-mem.c:10
void * pb_malloc(size_t sz)
Allocate a contiguous chunk of memory.
Definition pb-mem.c:7
void * pb_realloc(void *ptr, size_t sz)
Resize the memory area ptr to size sz.
Definition pb-mem.c:13
void * pb_memcpy(void *dest, const void *src, size_t sz)
copy a memory region
Definition pb-mem.c:18