-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix up the memory-functions for the C-lib
- Loading branch information
1 parent
94b4e0d
commit 93f5726
Showing
2 changed files
with
23 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef unsigned long size_t; | ||
#define NULL 0 | ||
|
||
static void* malloc(size_t size) { | ||
return NULL; | ||
} | ||
void *malloc(size_t size); | ||
|
||
void *realloc(void *mem, size_t size); | ||
|
||
void free(void *mem); | ||
|
||
void *memset(void *ptr, int value, size_t num); | ||
|
||
void *memcpy(void *destination, const void *source, size_t num); | ||
|
||
static void free(void* pointer) { | ||
int memcmp(const void *ptr1, const void *ptr2, size_t num); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |