[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #5687] api_lib.c: allocate all 'struct api_msg' on s

From: goldsimon
Subject: [lwip-devel] [patch #5687] api_lib.c: allocate all 'struct api_msg' on stack instead of mem-pool
Date: Mon, 15 Jan 2007 10:01:41 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20061204 Firefox/


                 Summary: api_lib.c: allocate all 'struct api_msg' on stack
instead of mem-pool
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Montag 15.01.2007 um 10:01
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any



The messages passed between application thread and tcpip thread can be
allocated on the stack instead of through memp_malloc(), which should
minimize memory usage (struct api_msg is about 24 bytes, only one at a time
is allocated per thread) and should be (a little bit) faster (since
allocating on the stack is faster that memp_malloc()).

NOTE that in tcpip.c:179 the api_msg was deleted if allocation of
MEMP_TCPIP_MSG failed! This would leave the calling thread deadlocked since
it waits for an answer of the tcpip thread. Thus, the old version didn't work
anyway if the allocation failed...


File Attachments:

Date: Montag 15.01.2007 um 10:01  Name: patch_MEMP_API_MSG.patch  Size: 8kB  
By: goldsimon



Reply to this item at:


  Nachricht geschickt von/durch Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]