[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: |
FreeRTOS.org Info |
Subject: |
RE: [lwip-users] Using MEM_LIBC_MALLOC == 1 in an OS |
Date: |
Thu, 26 Feb 2009 10:39:13 -0000 |
> -----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.