diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-09-25 12:05:03 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-09-25 12:05:03 +0000 |
commit | 7e44438936091746fd5b192ca2fae3cd1b105713 (patch) | |
tree | f24ffcbc1612a3e8316af2b932ec41a5fa7b09ad /lib/skin_parser/skin_buffer.h | |
parent | d7372533d07c3168715f9efdace76da1d3983fee (diff) | |
download | rockbox-7e44438936091746fd5b192ca2fae3cd1b105713.tar.gz rockbox-7e44438936091746fd5b192ca2fae3cd1b105713.zip |
Add a simple perl script to display info about what is allocating skin buffer.
To use it enable DEBUG_SKIN_ALLOCATIONS in skin_buffer.h and pipe the rockboxui output to the script
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30597 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'lib/skin_parser/skin_buffer.h')
-rw-r--r-- | lib/skin_parser/skin_buffer.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/skin_parser/skin_buffer.h b/lib/skin_parser/skin_buffer.h index 1698b8afb2..b2ed34e09f 100644 --- a/lib/skin_parser/skin_buffer.h +++ b/lib/skin_parser/skin_buffer.h | |||
@@ -27,7 +27,18 @@ | |||
27 | #define _SKIN_BUFFFER_H_ | 27 | #define _SKIN_BUFFFER_H_ |
28 | void skin_buffer_init(char* buffer, size_t size); | 28 | void skin_buffer_init(char* buffer, size_t size); |
29 | /* Allocate size bytes from the buffer */ | 29 | /* Allocate size bytes from the buffer */ |
30 | |||
31 | /* #define DEBUG_SKIN_ALLOCATIONS */ | ||
32 | |||
33 | #ifdef DEBUG_SKIN_ALLOCATIONS | ||
34 | #define FOO(X) #X | ||
35 | #define STRNG(X) FOO(X) | ||
36 | #define skin_buffer_alloc(s) skin_buffer_alloc_ex(s, __FILE__ ":" STRNG(__LINE__)) | ||
37 | void* skin_buffer_alloc_ex(size_t size, char* str); | ||
38 | #else | ||
30 | void* skin_buffer_alloc(size_t size); | 39 | void* skin_buffer_alloc(size_t size); |
40 | #endif | ||
41 | |||
31 | 42 | ||
32 | /* get the number of bytes currently being used */ | 43 | /* get the number of bytes currently being used */ |
33 | size_t skin_buffer_usage(void); | 44 | size_t skin_buffer_usage(void); |