From 9e07ef2b0adb8fca7e5a9e516397e533653f8836 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Tue, 15 Nov 2011 14:11:08 +0000 Subject: 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 --- lib/skin_parser/skin_buffer.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/skin_parser/skin_buffer.h') 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 @@ void skin_buffer_init(char* buffer, size_t size); /* Allocate size bytes from the buffer */ +#ifndef __PCTOOL__ +#define INVALID_OFFSET (-1) +#define IS_VALID_OFFSET(o) ((o) >= 0) +long skin_buffer_to_offset(void *pointer); +void* skin_buffer_from_offset(long offset); +#else +#define INVALID_OFFSET (NULL) +#define IS_VALID_OFFSET(o) ((o) != NULL) +#define skin_buffer_to_offset(p) p +#define skin_buffer_from_offset(o) o +#endif + /* #define DEBUG_SKIN_ALLOCATIONS */ #ifdef DEBUG_SKIN_ALLOCATIONS @@ -44,7 +56,4 @@ void* skin_buffer_alloc(size_t size); size_t skin_buffer_usage(void); size_t skin_buffer_freespace(void); -/* save and restore a buffer position incase a skin fails to load */ -void skin_buffer_save_position(void); -void skin_buffer_restore_position(void); #endif -- cgit v1.2.3