forked from len0rd/rockbox
bmalloc_status() only works if compiled with DEBUG
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@595 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3eec33f9c6
commit
a1d678444c
1 changed files with 5 additions and 3 deletions
|
|
@ -238,12 +238,13 @@ static void bmalloc_failed(size_t size)
|
||||||
#define bmalloc_failed(x)
|
#define bmalloc_failed(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void bmalloc_status()
|
void bmalloc_status(void)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
struct BlockInfo *block = blockHead;
|
struct BlockInfo *block = blockHead;
|
||||||
long mem_free = 0;
|
long mem_free = 0;
|
||||||
long mem_used = 0;
|
long mem_used = 0;
|
||||||
#if 1
|
|
||||||
printf("List of BLOCKS (in address order):\n");
|
printf("List of BLOCKS (in address order):\n");
|
||||||
while(block) {
|
while(block) {
|
||||||
printf(" START %p END %p SIZE %ld FLAG %s\n",
|
printf(" START %p END %p SIZE %ld FLAG %s\n",
|
||||||
|
|
@ -259,10 +260,11 @@ void bmalloc_status()
|
||||||
}
|
}
|
||||||
printf(" Used mem: %ld , free mem: %ld (total %ld)\n",
|
printf(" Used mem: %ld , free mem: %ld (total %ld)\n",
|
||||||
mem_used, mem_free, mem_used + mem_free);
|
mem_used, mem_free, mem_used + mem_free);
|
||||||
#endif
|
|
||||||
bmalloc_print_sizes();
|
bmalloc_print_sizes();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *bmalloc(size_t size)
|
void *bmalloc(size_t size)
|
||||||
{
|
{
|
||||||
void *mem;
|
void *mem;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue