[U-Boot] [PATCH] malloc_simple: Add simple malloc free function

Simon Glass sjg at chromium.org
Thu Aug 4 03:17:00 CEST 2016


Hi,

On 2 August 2016 at 21:24, Chin Liang See <clsee at altera.com> wrote:
> Enable a simple malloc implementation which will minimize
> memory usage prior relocation. This is essential as memory
> available prior location is internal memory and limited in
> size.
>
> This implementation will stored last 2 usage of malloc. When
> free is invoked and the free address matched, we shall revert
> to previous value of gd->malloc_ptr that we stored.

I'm really not keen on this patch. Can we not adjust the FAT code to
avoid repeated malloc()/free()?


>
> Signed-off-by: Chin Liang See <clsee at altera.com>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: Dinh Nguyen <dinguyen at opensource.altera.com>
> Cc: Tien Fong Chee <tfchee at altera.com>
> ---
>  common/dlmalloc.c                 |  6 ++++--
>  common/malloc_simple.c            | 34 ++++++++++++++++++++++++++++++++++
>  include/asm-generic/global_data.h |  2 ++
>  include/malloc.h                  |  3 ++-
>  4 files changed, 42 insertions(+), 3 deletions(-)

Regards,
Simon


More information about the U-Boot mailing list