patchAVR C Runtime Library - Patches: patch #6895, Improved malloc behaviour when...

 
 

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

patch #6895: Improved malloc behaviour when expanding used area

Submitter:  Stefan Ernst <sternst>
Submitted:  Thu 13 Aug 2009 01:07:25 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  joerg_wunsch Open/Closed:  Closed

Fri 04 Jun 2010 02:42:06 PM UTC, comment #1: 

Patch applied (and testscript added), thanks!

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 13 Aug 2009 01:07:25 PM UTC, original submission:  

This is a patch as a suggestion related to topic #1 in bug report #27235

Situation:

  a = malloc(10);
  b = malloc(10);
  free(b);
Now there is a free chunk at the end of the used area of the heap.
  b = malloc(20);
The new request can not be satisfied by any free chunk, therefore the used area needs to be expanded.

Current code:

The request is satisfied completely with fresh new memory from the expansion. Result: there is a free chunk between a and b, and the used area is bigger than necessary.

Patch:

The free chunk at the end of the used area is delivered to the request and the expansion is made only for the remaining part.

Stefan Ernst <sternst>

 

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

Attached Files
file #18567:  malloc.diff added by sternst (859B - 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 joerg_wunsch (Posted a comment)
  • -email is unavailable- added by sternst (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-04 joerg_wunsch StatusNone Done
        Assigned toNone joerg_wunsch
        Open/ClosedOpen Closed
    2009-08-13 sternst Attached File- Added malloc.diff, #18567

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code