diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-11-15 14:11:08 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-11-15 14:11:08 +0000 |
commit | 9e07ef2b0adb8fca7e5a9e516397e533653f8836 (patch) | |
tree | 0a283550421917e52ee04068b84a464976f0c4f2 /lib/skin_parser/skin_buffer.h | |
parent | 101693fd3047fb64e766580e80635a424fa25c4d (diff) | |
download | rockbox-9e07ef2b0adb8fca7e5a9e516397e533653f8836.tar.gz rockbox-9e07ef2b0adb8fca7e5a9e516397e533653f8836.zip |
Use buflib for all skin engine allocations.
Massive thanks to Michael Chicoine and other testers for finding the early bugs.
This removes all skin memory limitations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'lib/skin_parser/skin_buffer.h')
-rw-r--r-- | lib/skin_parser/skin_buffer.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/skin_parser/skin_buffer.h b/lib/skin_parser/skin_buffer.h index b2ed34e09f..7c9bb0b9c0 100644 --- a/lib/skin_parser/skin_buffer.h +++ b/lib/skin_parser/skin_buffer.h | |||
@@ -28,6 +28,18 @@ | |||
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 | 30 | ||
31 | #ifndef __PCTOOL__ | ||
32 | #define INVALID_OFFSET (-1) | ||
33 | #define IS_VALID_OFFSET(o) ((o) >= 0) | ||
34 | long skin_buffer_to_offset(void *pointer); | ||
35 | void* skin_buffer_from_offset(long offset); | ||
36 | #else | ||
37 | #define INVALID_OFFSET (NULL) | ||
38 | #define IS_VALID_OFFSET(o) ((o) != NULL) | ||
39 | #define skin_buffer_to_offset(p) p | ||
40 | #define skin_buffer_from_offset(o) o | ||
41 | #endif | ||
42 | |||
31 | /* #define DEBUG_SKIN_ALLOCATIONS */ | 43 | /* #define DEBUG_SKIN_ALLOCATIONS */ |
32 | 44 | ||
33 | #ifdef DEBUG_SKIN_ALLOCATIONS | 45 | #ifdef DEBUG_SKIN_ALLOCATIONS |
@@ -44,7 +56,4 @@ void* skin_buffer_alloc(size_t size); | |||
44 | size_t skin_buffer_usage(void); | 56 | size_t skin_buffer_usage(void); |
45 | size_t skin_buffer_freespace(void); | 57 | size_t skin_buffer_freespace(void); |
46 | 58 | ||
47 | /* save and restore a buffer position incase a skin fails to load */ | ||
48 | void skin_buffer_save_position(void); | ||
49 | void skin_buffer_restore_position(void); | ||
50 | #endif | 59 | #endif |