From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chin Liang See Date: Thu, 4 Aug 2016 23:09:56 +0800 Subject: [U-Boot] [PATCH] malloc_simple: Add simple malloc free function In-Reply-To: References: <1470194652-2461-1-git-send-email-clsee@altera.com> Message-ID: <1470323396.2136.5.camel@altera.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2016-08-03 at 19:17 -0600, Simon Glass wrote: > Hi, > Hi Simon, > On 2 August 2016 at 21:24, Chin Liang See 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()? > Sure and let me take a look on enhancing the FAT driver for the malloc/free aspect. Thanks Chin Liang > > > > > Signed-off-by: Chin Liang See > > Cc: Marek Vasut > > Cc: Simon Glass > > Cc: Tom Rini > > Cc: Dinh Nguyen > > Cc: Tien Fong Chee > > --- > > 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