summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-16 14:16:48 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-16 14:16:48 +0000
commitd902f94313fe24826cfd2719bb6cc63ae8157a13 (patch)
tree51d40901073683b720cb963304074dbe50e71a37 /firmware
parenta1d678444c713218bc18ae7bc7b2f497da512a18 (diff)
downloadrockbox-d902f94313fe24826cfd2719bb6cc63ae8157a13.tar.gz
rockbox-d902f94313fe24826cfd2719bb6cc63ae8157a13.zip
DEBUG => DEBUG_MALLOC, the symbol is already in use!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@596 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/malloc/Makefile2
-rw-r--r--firmware/malloc/bmalloc.c4
-rw-r--r--firmware/malloc/bysize.c4
-rw-r--r--firmware/malloc/bysize.h2
-rw-r--r--firmware/malloc/dmalloc.c8
-rw-r--r--firmware/malloc/dmalloc.h13
6 files changed, 14 insertions, 19 deletions
diff --git a/firmware/malloc/Makefile b/firmware/malloc/Makefile
index d4c6436184..4524d0630b 100644
--- a/firmware/malloc/Makefile
+++ b/firmware/malloc/Makefile
@@ -21,7 +21,7 @@ LIBOBJS = dmalloc.o bmalloc.o bysize.o
21 21
22# define this to talk a lot in runtime 22# define this to talk a lot in runtime
23# -DDEBUG_VERBOSE 23# -DDEBUG_VERBOSE
24CFLAGS = -g -Wall -DDEBUG 24CFLAGS = -g -W -Wall -DDEBUG_MALLOC
25CC = gcc 25CC = gcc
26AR = ar 26AR = ar
27 27
diff --git a/firmware/malloc/bmalloc.c b/firmware/malloc/bmalloc.c
index a26c5c68a0..470ee49840 100644
--- a/firmware/malloc/bmalloc.c
+++ b/firmware/malloc/bmalloc.c
@@ -38,7 +38,7 @@
38#define FALSE 0 38#define FALSE 0
39#endif 39#endif
40 40
41/* #define DEBUG */ 41/* #define DEBUG_MALLOC */
42 42
43#define BMEM_ALIGN 64 /* resolution */ 43#define BMEM_ALIGN 64 /* resolution */
44 44
@@ -240,7 +240,7 @@ static void bmalloc_failed(size_t size)
240 240
241void bmalloc_status(void) 241void bmalloc_status(void)
242{ 242{
243#ifdef DEBUG 243#ifdef DEBUG_MALLOC
244 struct BlockInfo *block = blockHead; 244 struct BlockInfo *block = blockHead;
245 long mem_free = 0; 245 long mem_free = 0;
246 long mem_used = 0; 246 long mem_used = 0;
diff --git a/firmware/malloc/bysize.c b/firmware/malloc/bysize.c
index c8e2759cec..437159579c 100644
--- a/firmware/malloc/bysize.c
+++ b/firmware/malloc/bysize.c
@@ -388,7 +388,7 @@ Tree *removebyaddr(Tree *t, Tree *remove)
388 return x; 388 return x;
389} 389}
390 390
391#ifdef DEBUG 391#ifdef DEBUG_MALLOC
392static 392static
393int printtree(Tree * t, int d, char output) 393int printtree(Tree * t, int d, char output)
394{ 394{
@@ -441,7 +441,7 @@ char *bmalloc_obtainbysize( size_t size)
441 return (char *)receive; 441 return (char *)receive;
442} 442}
443 443
444#ifdef DEBUG 444#ifdef DEBUG_MALLOC
445void bmalloc_print_sizes(void) 445void bmalloc_print_sizes(void)
446{ 446{
447 printtree(chunkHead, 0, 1); 447 printtree(chunkHead, 0, 1);
diff --git a/firmware/malloc/bysize.h b/firmware/malloc/bysize.h
index c4621328bf..34be8f9021 100644
--- a/firmware/malloc/bysize.h
+++ b/firmware/malloc/bysize.h
@@ -19,6 +19,6 @@
19void bmalloc_remove_chunksize(void *data); 19void bmalloc_remove_chunksize(void *data);
20void bmalloc_insert_bysize(char *data, size_t size); 20void bmalloc_insert_bysize(char *data, size_t size);
21char *bmalloc_obtainbysize( size_t size); 21char *bmalloc_obtainbysize( size_t size);
22#ifdef DEBUG 22#ifdef DEBUG_MALLOC
23void bmalloc_print_sizes(void); 23void bmalloc_print_sizes(void);
24#endif 24#endif
diff --git a/firmware/malloc/dmalloc.c b/firmware/malloc/dmalloc.c
index cf286e54b4..28215563dc 100644
--- a/firmware/malloc/dmalloc.c
+++ b/firmware/malloc/dmalloc.c
@@ -29,7 +29,7 @@
29#include <stdio.h> 29#include <stdio.h>
30#include <string.h> /* memcpy */ 30#include <string.h> /* memcpy */
31 31
32#ifdef DEBUG 32#ifdef DEBUG_MALLOC
33#include <stdarg.h> 33#include <stdarg.h>
34#endif 34#endif
35 35
@@ -106,7 +106,7 @@ struct MemInfo {
106 anyway: */ 106 anyway: */
107#ifdef PSOS 107#ifdef PSOS
108 108
109#ifdef DEBUG 109#ifdef DEBUG_MALLOC
110#define DMEM_OSALLOCMEM(size,pointer,type) pointer=(type)dbgmalloc(size) 110#define DMEM_OSALLOCMEM(size,pointer,type) pointer=(type)dbgmalloc(size)
111#define DMEM_OSFREEMEM(x) dbgfree(x) 111#define DMEM_OSFREEMEM(x) dbgfree(x)
112#else 112#else
@@ -126,7 +126,7 @@ struct MemInfo {
126#ifdef BMALLOC /* use our own big-memory-allocation system */ 126#ifdef BMALLOC /* use our own big-memory-allocation system */
127#define DMEM_OSALLOCMEM(size,pointer,type) pointer=(type)bmalloc(size) 127#define DMEM_OSALLOCMEM(size,pointer,type) pointer=(type)bmalloc(size)
128#define DMEM_OSFREEMEM(x) bfree(x) 128#define DMEM_OSFREEMEM(x) bfree(x)
129#elif DEBUG 129#elif DEBUG_MALLOC
130#define DMEM_OSALLOCMEM(size,pointer,type) pointer=(type)dbgmalloc(size) 130#define DMEM_OSALLOCMEM(size,pointer,type) pointer=(type)dbgmalloc(size)
131#define DMEM_OSFREEMEM(x) dbgfree(x) 131#define DMEM_OSFREEMEM(x) dbgfree(x)
132#else 132#else
@@ -177,7 +177,7 @@ static struct MemTop top[ sizeof(qinfo)/sizeof(qinfo[0]) ];
177/* Start of the real code */ 177/* Start of the real code */
178/* ---------------------------------------------------------------------- */ 178/* ---------------------------------------------------------------------- */
179 179
180#ifdef DEBUG 180#ifdef DEBUG_MALLOC
181/************ 181/************
182 * A few functions that are verbose and tells us about the current status 182 * A few functions that are verbose and tells us about the current status
183 * of the dmalloc system 183 * of the dmalloc system
diff --git a/firmware/malloc/dmalloc.h b/firmware/malloc/dmalloc.h
index a4e0ab4f6b..3314e7e7d3 100644
--- a/firmware/malloc/dmalloc.h
+++ b/firmware/malloc/dmalloc.h
@@ -17,15 +17,10 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20void *dmalloc(size_t); 20void *malloc(size_t);
21void dfree(void *); 21void *calloc (size_t nmemb, size_t size);
22void *drealloc(void *, size_t); 22void free(void *);
23 23void *realloc(void *, size_t);
24#define malloc(x) dmalloc(x)
25#define free(x) dfree(x)
26#define realloc(x,y) drealloc(x,y)
27#define calloc(x,y) dcalloc(x,y)
28
29 24
30/* use this to intialize the internals of the dmalloc engine */ 25/* use this to intialize the internals of the dmalloc engine */
31void dmalloc_initialize(void); 26void dmalloc_initialize(void);