mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
sandbox: Avoid using malloc() for system state
This state is not accessible to the running U-Boot but at present it is allocated in the emulated SDRAM. This doesn't seem very useful. Adjust it to allocate from the OS instead. The RAM buffer is currently not freed, but should be, so add that into state_uninit(). Update the comment for os_free() to indicate that NULL is a valid parameter value. Note that the strdup() in spl_board_load_image() is changed as well, since strdup() allocates memory in the RAM buffer. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -123,7 +123,8 @@ void *os_malloc(size_t length);
|
||||
*
|
||||
* This returns the memory to the OS.
|
||||
*
|
||||
* @ptr: Pointer to memory block to free
|
||||
* @ptr: Pointer to memory block to free. If this is NULL then this
|
||||
* function does nothing
|
||||
*/
|
||||
void os_free(void *ptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user