basecmd: Avoid calling malloc() from main code

Introduce a new board function alloc_chunk() to allocate dynamic
memory.  This allows the board code to implement memory allocations
without using the standard malloc() interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2017-05-06 22:29:08 -04:00
parent 8f1d0c2a7c
commit f331936969
6 changed files with 66 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
// Main starting point for SAM3x8e boards.
//
// Copyright (C) 2016 Kevin O'Connor <kevin@koconnor.net>
// Copyright (C) 2016,2017 Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.
@@ -43,12 +43,6 @@ command_reset(uint32_t *args)
}
DECL_COMMAND_FLAGS(command_reset, HF_IN_SHUTDOWN, "reset");
size_t
alloc_maxsize(size_t reqsize)
{
return reqsize;
}
void * __visible
_sbrk(int nbytes)
{