patchlwIP - A Lightweight TCP/IP stack - Patches: patch #5913, memp.c: don't waste memory

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #5913: memp.c: don't waste memory

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Thu 03 May 2007 06:17:27 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Fri 04 May 2007 03:52:43 PM UTC, comment #2: 

Checked this in (also eliminating local variable "ram").

Closing as Done.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 03 May 2007 07:18:00 PM UTC, comment #1: 

I agree with your analysis, well spotted!

Jonathan Larmour <jifl>
Group Member
Thu 03 May 2007 06:17:27 PM UTC, original submission:  

On allocation using mem_malloc(), the returned pointer (mem) is put MEMP_SIZE after the original struct memp. However, since the 'next' pointer of struct memp is not used while not in the pool, we can return the struct memp as mem, resulting in not wasting the 4 bytes (for me, could be more or less :) used for struct memp. Not much, but bit by bit...

See attached patch

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #12682:  memp.c.patch added by goldsimon (897B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jifl (Posted a comment)
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-05-04 goldsimon StatusNone Done
        Open/ClosedOpen Closed
    2007-05-03 goldsimon Attached File- Added memp.c.patch, #12682

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code