|
|
|
@ -23,6 +23,7 @@
|
|
|
|
|
|
|
|
|
|
#include "libiec61850_platform_includes.h"
|
|
|
|
|
#include "simple_allocator.h"
|
|
|
|
|
#include "stack_config.h"
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MemoryAllocator_init(MemoryAllocator* self, char* memoryBlock, int size)
|
|
|
|
@ -35,10 +36,14 @@ MemoryAllocator_init(MemoryAllocator* self, char* memoryBlock, int size)
|
|
|
|
|
int inline
|
|
|
|
|
MemoryAllocator_getAlignedSize(int size)
|
|
|
|
|
{
|
|
|
|
|
#if (CONFIG_IEC61850_FORCE_MEMORY_ALIGNMENT == 1)
|
|
|
|
|
if ((size % sizeof(void*)) > 0)
|
|
|
|
|
return sizeof(void*) * ((size + sizeof(void*) - 1) / sizeof(void*));
|
|
|
|
|
else
|
|
|
|
|
return size;
|
|
|
|
|
#else
|
|
|
|
|
return size;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char*
|
|
|
|
|