File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 5
5
#include <sys/lcd.h>
6
6
#include <debug.h>
7
7
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,
9
9
// but requires you to only use the first part of the VRAM for the LCD configured in 8bpp.
10
10
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
12
13
13
14
static unsigned int freeslotpos (unsigned int n )
14
15
{
@@ -101,9 +102,6 @@ void* _vram2_malloc(const size_t alloc_size)
101
102
if (alloc_size == 0 )
102
103
return NULL ;
103
104
104
- if (alloc_size == 0xFFFFFF )
105
- return (void * )((heap_ptrend - heap_ptr ) + (heap2_ptrend - heap2_ptr ));
106
-
107
105
if (alloc_size <= sizeof (char6_t ))
108
106
{
109
107
if (tab2 && alloc_size <= sizeof (char2_t ))
@@ -330,8 +328,8 @@ void* _vram2_realloc(void* ptr, const size_t size)
330
328
}
331
329
332
330
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 ])))
335
333
{
336
334
// ok
337
335
}
You can’t perform that action at this time.
0 commit comments