File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 55#include <sys/lcd.h>
66#include <debug.h>
77
8- // This allocator uses the 2nd part of the VRAM as the heap. It gives you 76K of memory,
8+ // This allocator uses the 2nd part of the VRAM as another area for heap allocations, providing 76KB more memory,
99// but requires you to only use the first part of the VRAM for the LCD configured in 8bpp.
1010
11- #define MALLOC_MINSIZE 6 // minimal size (avoid blocks that are too small)
11+ // minimal size (avoid blocks that are too small)
12+ #define MALLOC_MINSIZE 6
1213
1314static unsigned int freeslotpos (unsigned int n )
1415{
@@ -101,9 +102,6 @@ void* _vram2_malloc(const size_t alloc_size)
101102 if (alloc_size == 0 )
102103 return NULL ;
103104
104- if (alloc_size == 0xFFFFFF )
105- return (void * )((heap_ptrend - heap_ptr ) + (heap2_ptrend - heap2_ptr ));
106-
107105 if (alloc_size <= sizeof (char6_t ))
108106 {
109107 if (tab2 && alloc_size <= sizeof (char2_t ))
@@ -330,8 +328,8 @@ void* _vram2_realloc(void* ptr, const size_t size)
330328 }
331329
332330 if ((((size_t )ptr >= (size_t )& tab2 [0 ]) && ((size_t )ptr < (size_t )& tab2 [ALLOC2 ])) ||
333- (((size_t )ptr >= (size_t )& tab3 [0 ]) && ((size_t )ptr < (size_t )& tab3 [ALLOC2 ])) ||
334- (((size_t )ptr >= (size_t )& tab6 [0 ]) && ((size_t )ptr < (size_t )& tab6 [ALLOC2 ])))
331+ (((size_t )ptr >= (size_t )& tab3 [0 ]) && ((size_t )ptr < (size_t )& tab3 [ALLOC3 ])) ||
332+ (((size_t )ptr >= (size_t )& tab6 [0 ]) && ((size_t )ptr < (size_t )& tab6 [ALLOC6 ])))
335333 {
336334 // ok
337335 }
You can’t perform that action at this time.
0 commit comments