[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] Using MEM_LIBC_MALLOC == 1 in an OS
From: |
Edward Harris |
Subject: |
RE: [lwip-users] Using MEM_LIBC_MALLOC == 1 in an OS |
Date: |
Thu, 26 Feb 2009 11:00:58 -0000 |
Thanks for that.
I do use heap_3.c, as I only have a small amount of RAM and so need to
allocate just one heap.
I suspect that I should add mem_free() mem_malloc() etc. macros to
lwipopts that map to the FreeRTOS protected versions (pvPortMalloc() and
vPortFree()).
Can anyone advise on SYS_LIGHTWEIGHT_PROT, please?
Thanks,
Edward Harris
Cyan Technology
-----Original Message-----
From: address@hidden
[mailto:address@hidden
On Behalf Of FreeRTOS.org Info
Sent: 26 February 2009 10:39
To: 'Mailing list for lwIP users'
Subject: RE: [lwip-users] Using MEM_LIBC_MALLOC == 1 in an OS
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf
> Of Edward Harris
> Sent: 26 February 2009 10:03
> To: Mailing list for lwIP users
> Subject: [lwip-users] Using MEM_LIBC_MALLOC == 1 in an OS
>
> Hello all.
>
> I have just spotted a possible issue in the LwIP port that I am
> working with under an OS (FreeRTOS).
>
> The issue is that I have set MEM_LIBC_MALLOC = 1, to use the standard
> C
> malloc() and free(), however as I'm using an OS, should I redirect the
> mem_xxx() macros to the OS protected versions?
>
> Also, can someone clarify the use of SYS_LIGHTWEIGHT_PROT, should I
> have it set to 1?
>
This does not answer the question directly, but in FreeRTOS if you
include heap_3.c in your project then the FreeRTOS heap calls just use
the standard malloc too - but protected by a critical region (actually a
scheduler lock so interrupts remain enabled). It would then seem to
make sense for the lwIP calls to use the same functions.
Regards,
Richard.
+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.
+ http://www.FreeRTOS.org/Documentation
New FreeRTOS eBook - learn how to use an RTOS.
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users