This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: init priority fix for memory pools


On 10/24/07, Jonathan Larmour <jifl@ecoscentric.com> wrote:
> Øyvind Harboe wrote:
> > On 10/24/07, Jonathan Larmour <jifl@ecoscentric.com> wrote:
> >
> >>Øyvind Harboe wrote:
> >>
> >>>On 10/24/07, Jonathan Larmour <jifl@ecoscentric.com> wrote:
> >>>
> >>>
> >>>>Øyvind Harboe wrote:
> >>>>
> >>>>
> >>>>>Why was it CYG_INIT_LIBC?
> >>>>>
> >>>>>CYG_INIT_MEMALLOC seems like the right thing, e.g. jffs2 allocates
> >>>>>memory and CYG_INIT_LIBC is after IO.
> >>>>>
> >>>>>I discovered this when working w/multiple heaps.
> >>>>
> >>>>Yes, I can't remember any rationale for doing it before CYG_INIT_LIBC
> >>>>instead. Probably was just some old leftover. Applied, thanks.
> >>>
> >>>
> >>>Ooops. I screwed up the first patch. The tcl script needs to be fixed as well.
> >>
> >>Done, albeit slightly differently.
> >
> >
> > It's broken now. The problem is that it needs to be "before
> > before"(-200), not "before" -100.
>
> Oh, I didn't notice your patch kept it as CYGBLD_ATTRIB_INIT_BEFORE. It
> should be CYGBLD_ATTRIB_INIT_PRI, as per below. Checked in.

Hmmm... I think I need to test this tomorrow. I wonder if there are
three things that need to happen in order: heap init, joined heap
init, malloc init. Not sure if the last one and joined heap init are
the same though.

>
> Jifl
>
> Index: src/malloc.cxx
> ===================================================================
> RCS file:
> /cvs/ecos/ecos/packages/services/memalloc/common/current/src/malloc.cxx,v
> retrieving revision 1.6
> diff -u -5 -p -r1.6 malloc.cxx
> --- src/malloc.cxx      24 Oct 2007 12:42:38 -0000      1.6
> +++ src/malloc.cxx      24 Oct 2007 16:17:48 -0000
> @@ -84,11 +84,11 @@
>   cyg_uint8 cyg_memalloc_mallocpool_memory[
>       CYGNUM_MEMALLOC_FALLBACK_MALLOC_POOL_SIZE ] CYGBLD_ATTRIB_WEAK;
>
>   // the memory pool object itself
>   CYGCLS_MEMALLOC_MALLOC_IMPL cyg_memalloc_mallocpool
> -   CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_MEMALLOC ) =
> +   CYGBLD_ATTRIB_INIT_PRI( CYG_INIT_MEMALLOC ) =
>      CYGCLS_MEMALLOC_MALLOC_IMPL( cyg_memalloc_mallocpool_memory,
>                                   sizeof( cyg_memalloc_mallocpool_memory ) );
>
>   # define POOL cyg_memalloc_mallocpool
>
> @@ -101,11 +101,11 @@ CYGCLS_MEMALLOC_MALLOC_IMPL cyg_memalloc
>   // multiple heaps
>
>   # include <cyg/memalloc/memjoin.hxx>
>
>   Cyg_Mempool_Joined<CYGCLS_MEMALLOC_MALLOC_IMPL> cyg_memalloc_mallocpool
> -   CYGBLD_ATTRIB_INIT_BEFORE( CYG_INIT_MEMALLOC ) =
> +   CYGBLD_ATTRIB_INIT_PRI( CYG_INIT_MEMALLOC ) =
>        Cyg_Mempool_Joined<CYGCLS_MEMALLOC_MALLOC_IMPL>(
>          CYGMEM_HEAP_COUNT, cygmem_memalloc_heaps
>        );
>
>   # define POOL cyg_memalloc_mallocpool
>
> --
> eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
> Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
> Registered in England and Wales: Reg No 4422071.
> ------["The best things in life aren't things."]------      Opinions==mine
>


-- 
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA  developer kit


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]