summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2009-07-23 21:37:35 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2009-07-23 21:37:35 +0000
commit840cd1069292e3f29d18e57f2274ec1e979f858b (patch)
tree0ee1d43fa3863de53c99432dc32001e625703d1c /apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c
parent0d9b7ec73e71188632a4fd584dfd745aeb7571b3 (diff)
downloadrockbox-840cd1069292e3f29d18e57f2274ec1e979f858b.tar.gz
rockbox-840cd1069292e3f29d18e57f2274ec1e979f858b.zip
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
Diffstat (limited to 'apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c')
-rw-r--r--apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c b/apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c
index 47b461bac5..35bdc70290 100644
--- a/apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c
+++ b/apps/plugins/pdbox/TLSF-2.4.4/src/tlsf.c
@@ -164,8 +164,14 @@
164#define PAGE_SIZE (getpagesize()) 164#define PAGE_SIZE (getpagesize())
165#endif 165#endif
166 166
167#if defined(ROCKBOX) && defined(SIMULATOR) || !defined(ROCKBOX)
168int printf(char*, ...);
167#define PRINT_MSG(fmt, args...) printf(fmt, ## args) 169#define PRINT_MSG(fmt, args...) printf(fmt, ## args)
168#define ERROR_MSG(fmt, args...) printf(fmt, ## args) 170#define ERROR_MSG(fmt, args...) printf(fmt, ## args)
171#else
172#define PRINT_MSG(fmt, args...)
173#define ERROR_MSG(fmt, args...)
174#endif
169 175
170typedef unsigned int u32_t; /* NOTE: Make sure that this type is 4 bytes long on your computer */ 176typedef unsigned int u32_t; /* NOTE: Make sure that this type is 4 bytes long on your computer */
171typedef unsigned char u8_t; /* NOTE: Make sure that this type is 1 byte on your computer */ 177typedef 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)
567#if TLSF_STATISTIC 573#if TLSF_STATISTIC
568 return ((tlsf_t *) mem_pool)->used_size; 574 return ((tlsf_t *) mem_pool)->used_size;
569#else 575#else
576#ifdef ROCKBOX
577 (void) mem_pool;
578#endif /* ROCKBOX */
570 return 0; 579 return 0;
571#endif 580#endif
572} 581}
@@ -578,6 +587,9 @@ size_t get_max_size(void *mem_pool)
578#if TLSF_STATISTIC 587#if TLSF_STATISTIC
579 return ((tlsf_t *) mem_pool)->max_size; 588 return ((tlsf_t *) mem_pool)->max_size;
580#else 589#else
590#ifdef ROCKBOX
591 (void) mem_pool;
592#endif /* ROCKBOX */
581 return 0; 593 return 0;
582#endif 594#endif
583} 595}