[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] malloc and sys_arch
From: |
Adam Dunkels |
Subject: |
[lwip-users] Re: [lwip] malloc and sys_arch |
Date: |
Thu, 09 Jan 2003 01:34:48 -0000 |
On Wed, 2002-11-13 at 23:15, Kieran Mansley wrote:
> On Wed, 13 Nov 2002, mt wrote:
> > The problem I'm running into is this:
> > mem_init calls sys_sem_new() to setup mem_sem
> > sys_sem_new() calls malloc()
> > malloc() is really mem_malloc()
> > mem_malloc() waits for mem_sem
> > mem_sem isn't setup yet.
> >
> > does anyone else use mem_malloc as thier malloc? with
> > threads? any (-clean-) ideas?
>
> I don't (just use the standard malloc as it's faster) but you do seem to
> have a point. I can't believe that no one would have run into this before
> though, so it *must* be ok! Anyone got any thoughts on what might be the
> problem?
I think it (i.e., the sys_arch.c for the unix arch) has only been used
in systems where malloc() isn't the same as mem_malloc(). In such
systems there is no problem.
A workaround would be to rewrite the sys_arch.c so that it doesn't
allocate memory for the semaphores with malloc() but with a static
memory allocation scheme similar to the memp stuff.
/adam
--
Adam Dunkels <address@hidden>
[This message was sent through the lwip discussion list.]
- [lwip-users] Re: [lwip] malloc and sys_arch,
Adam Dunkels <=