patchAVR C Runtime Library - Patches: patch #6935, Patch for malloc()

 
 

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

patch #6935: Patch for malloc()

Submitter:  Michael Baeuerle <micha123>
Submitted:  Tue 06 Oct 2009 08:11:37 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  joerg_wunsch Open/Closed:  Closed

Tue 08 Jun 2010 01:47:00 PM UTC, comment #3: 

OK, we can close this then.

Please test the rewritten implementation to see whether it
works the way you expect it to.  I wrote some test scripts,
too, but the more people look at it, the better.

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 08 Jun 2010 01:40:40 PM UTC, comment #2: 

The problem was that the memory beyond the last used chunk was not always available. If malloc() is called with a size that fits after the last used chunk but is larger than every block in the freelist and larger than the unused space beyond the freelist, the request was rejected.
The patch let malloc() delete the last block from the freelist before the new chunk is allocated.
If free() can now ensure that the freelist always end before the last used chunk, this situation can no longer occur and this patch for malloc() is not needed.

Michael Baeuerle <micha123>
Tue 08 Jun 2010 11:14:30 AM UTC, comment #1: 

I reimplemented some parts of free() yesterday, so __brkval
is now lowered again when freeing the topmost chunk of
memory.  Please tell me whether your patch would still be
applicable.

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 06 Oct 2009 08:11:37 AM UTC, original submission:  

This patch is for avr-libc 1.6.7. It allows malloc() to combine new memory from heap extension with the last block in the freelist (if there are no used blocks in between).

Michael Baeuerle <micha123>

 

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

Attached Files
file #18819:  malloc_patch added by micha123 (2KiB - application/octet-stream)

 

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 micha123 (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-08 joerg_wunsch StatusNeed Info Wont Do
        Open/ClosedOpen Closed
    2010-06-08 joerg_wunsch StatusNone Need Info
        Assigned toNone joerg_wunsch
    2009-10-06 micha123 Attached File- Added malloc_patch, #18819

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code