Another pdbox patch by Wincent Balin (FS #10416): switch to using TLSF as memory allocator. Probably the last patch I commit for him, next changes are for him :)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22017 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2009-07-23 21:37:35 +00:00
parent 0d9b7ec73e
commit 840cd10692
21 changed files with 125 additions and 2357 deletions

View file

@ -164,8 +164,14 @@
#define PAGE_SIZE (getpagesize())
#endif
#if defined(ROCKBOX) && defined(SIMULATOR) || !defined(ROCKBOX)
int printf(char*, ...);
#define PRINT_MSG(fmt, args...) printf(fmt, ## args)
#define ERROR_MSG(fmt, args...) printf(fmt, ## args)
#else
#define PRINT_MSG(fmt, args...)
#define ERROR_MSG(fmt, args...)
#endif
typedef unsigned int u32_t; /* NOTE: Make sure that this type is 4 bytes long on your computer */
typedef unsigned char u8_t; /* NOTE: Make sure that this type is 1 byte on your computer */
@ -567,6 +573,9 @@ size_t get_used_size(void *mem_pool)
#if TLSF_STATISTIC
return ((tlsf_t *) mem_pool)->used_size;
#else
#ifdef ROCKBOX
(void) mem_pool;
#endif /* ROCKBOX */
return 0;
#endif
}
@ -578,6 +587,9 @@ size_t get_max_size(void *mem_pool)
#if TLSF_STATISTIC
return ((tlsf_t *) mem_pool)->max_size;
#else
#ifdef ROCKBOX
(void) mem_pool;
#endif /* ROCKBOX */
return 0;
#endif
}