forked from len0rd/rockbox
iriver: fix problem with playing some long vorbis files (e.g., this week in tech, #21); the decoder would run out of memory and freeze rockbox.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7526 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
59c995f58b
commit
f5ec0fa592
4 changed files with 19 additions and 4 deletions
|
@ -29,16 +29,21 @@
|
|||
* be implemented elsewhere */
|
||||
#define malloc(x) codec_malloc(x)
|
||||
#define calloc(x,y) codec_calloc(x,y)
|
||||
#define alloca(x) codec_alloca(x)
|
||||
#define realloc(x,y) codec_realloc(x,y)
|
||||
#define free(x) codec_free(x)
|
||||
|
||||
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);
|
||||
|
||||
#if !defined(SIMULATOR)
|
||||
#define alloca __builtin_alloca
|
||||
#else
|
||||
#define alloca(x) codec_alloca(x)
|
||||
void* codec_alloca(size_t size);
|
||||
#endif
|
||||
|
||||
#define abs(x) ((x)>0?(x):-(x))
|
||||
#define labs(x) abs(x)
|
||||
|
||||
|
|
|
@ -28,9 +28,13 @@ extern unsigned char* mallocbuf; /* 512K from the start of MP3 buffer */
|
|||
|
||||
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);
|
||||
|
||||
#if defined(SIMULATOR)
|
||||
void* codec_alloca(size_t size);
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
|
|
@ -56,12 +56,14 @@ void* codec_calloc(size_t nmemb, size_t size)
|
|||
return(x);
|
||||
}
|
||||
|
||||
#if defined(SIMULATOR)
|
||||
void* codec_alloca(size_t size)
|
||||
{
|
||||
void* x;
|
||||
x = codec_malloc(size);
|
||||
return(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
void codec_free(void* ptr) {
|
||||
(void)ptr;
|
||||
|
|
|
@ -46,9 +46,13 @@ extern unsigned char* filebuf; // The rest of the MP3 buffer
|
|||
|
||||
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);
|
||||
|
||||
#if defined(SIMULATOR)
|
||||
void* codec_alloca(size_t size);
|
||||
#endif
|
||||
|
||||
size_t strlen(const char *s);
|
||||
char *strcpy(char *dest, const char *src);
|
||||
char *strcat(char *dest, const char *src);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue