Hello Marek, On Mon, Sep 24, 2012 at 1:11 AM, Marek Vasut <ma...@denx.de> wrote: > Dear Tomas Hlavacek, > > [..] >> + >> + if (early_malloc_active()) { >> + addr = early_malloc(size); >> + for (i=0; i<size; i++) >> + addr[i] = 0; > > memset() ?
Yes, sure. Thanks. > >> + >> + return addr; >> + } >> +#endif /* CONFIG_SYS_EARLY_MALLOC */ >> + return calloc(n, elem_size); >> +} >> + >> +static inline void *dmrealloc(void *oldmem, size_t bytes) >> +{ >> +#ifdef CONFIG_SYS_EARLY_MALLOC >> + if (early_malloc_active()) >> + return NULL; > > I wonder how should this be implemented ... maybe early_malloc + standard > memcpy() How do you want me to fix all the pointers to the memcpyied part of heap then? I think this will not work unless I make some reservations for eventual growth for each and every early_mallocated area. And I think this is not good idea at all for early_malloc. I think there are two straight-forward possibilities: a) keep the empty implementation of dmrealloc() in early stage and avoid using it in code which might run in early stage, but retain the dm* version of the symbol. b) remove the dmrealloc() entirely which may have certain negative consequences, because it might be tempting to mix dmmalloc() and (non-dm*) realloc() calls which is obviously wrong. Tomas _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot