1
0
Fork 0
forked from len0rd/rockbox

Get malloc() and friends out of the way for the cygwin linker (and maybe others), to make plugins work properly in the simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6086 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-02-28 20:55:31 +00:00
parent c080f7e19e
commit b363d65625
43 changed files with 95 additions and 49 deletions

View file

@ -33,7 +33,7 @@ unsigned char* mp3buf; // The actual MP3 buffer from Rockbox
unsigned char* mallocbuf; // 512K from the start of MP3 buffer
unsigned char* filebuf; // The rest of the MP3 buffer
void* malloc(size_t size) {
void* codec_malloc(size_t size) {
void* x;
char s[32];
@ -46,27 +46,27 @@ void* malloc(size_t size) {
return(x);
}
void* calloc(size_t nmemb, size_t size) {
void* codec_calloc(size_t nmemb, size_t size) {
void* x;
x=malloc(nmemb*size);
x = codec_malloc(nmemb*size);
local_rb->memset(x,0,nmemb*size);
return(x);
}
void* alloca(size_t size) {
void* codec_alloca(size_t size) {
void* x;
x=malloc(size);
x = codec_malloc(size);
return(x);
}
void free(void* ptr) {
void codec_free(void* ptr) {
(void)ptr;
}
void* realloc(void* ptr, size_t size) {
void* codec_realloc(void* ptr, size_t size) {
void* x;
(void)ptr;
x=malloc(size);
x = codec_malloc(size);
return(x);
}

View file

@ -42,10 +42,11 @@ extern unsigned char* mp3buf; // The actual MP3 buffer from Rockbox
extern unsigned char* mallocbuf; // 512K from the start of MP3 buffer
extern unsigned char* filebuf; // The rest of the MP3 buffer
void* malloc(size_t size);
void* calloc(size_t nmemb, size_t size);
void free(void* ptr);
void* realloc(void* ptr, size_t size);
void* codec_malloc(size_t size);
void* codec_calloc(size_t nmemb, size_t size);
void* codec_alloca(size_t size);
void* codec_realloc(void* ptr, size_t size);
void codec_free(void* ptr);
void *memcpy(void *dest, const void *src, size_t n);
void *memset(void *s, int c, size_t n);
int memcmp(const void *s1, const void *s2, size_t n);