1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1274 Implement 4 bytes aligment for standard malloc (while keeping 8byte alignment for RTOS Stuctures) as done for M3

This commit is contained in:
Alessio Morale 2014-06-11 00:50:01 +02:00
parent c49497f2e0
commit b4c1a856c7

View File

@ -107,6 +107,12 @@ typedef unsigned long UBaseType_t;
#define portSTACK_GROWTH ( -1 )
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
#define portBYTE_ALIGNMENT 8
#define portBYTE_HEAP_ALIGNMENT 4 // this value is used to allocate heap
// Following define allow to keep a 8 bytes alignment for stack and other RTOS structures
// while using 4 bytes alignment for the remaining heap allocations to save ram
extern void *pvPortMallocGeneric( size_t xWantedSize, size_t alignment);
#define pvPortMallocAligned( x, puxStackBuffer ) ( ( ( puxStackBuffer ) == NULL ) ? ( pvPortMallocGeneric( ( x ) , portBYTE_ALIGNMENT) ) : ( puxStackBuffer ) )
/*-----------------------------------------------------------*/