(
Jump to the original submission)
Mon 07 Jun 2010 06:11:13 PM UTC, comment #6:
I backed out your patch, and instead rewrote free() so it
returns memory from the heap whenever the topmost chunk of
the freelist becomes free. While it increases the codesize
a little, it appears to be the cleanest solution to me.
If you still find any issue with this, please open a new
bug report, preferrably with a test case. Have a look at
the existing testcases to get an idea how they look like.
|
Mon 07 Jun 2010 02:46:07 PM UTC, comment #5:
Sorry, I confused that with bug #25723.
|
Mon 07 Jun 2010 02:39:24 PM UTC, comment #4:
Stefan, in bug #27242, you are talking about test cases you've
got for this bug here. I'm interested in getting them into
the tree, if you still have them.
|
Fri 04 Jun 2010 02:42:50 PM UTC, comment #3:
Patch for first part has been applied, and a testscript has
been added.
|
Wed 26 Aug 2009 08:58:02 PM UTC, comment #2:
Joerg, you're the most familiar with malloc stuff. Assigning to you.
|
Thu 13 Aug 2009 01:16:33 PM UTC, comment #1:
I added a patch as a suggestion for topic 1:
http://savannah.nongnu.org/patch/index.php?6895
|
Wed 12 Aug 2009 02:54:00 PM UTC, original submission:
Already discussed here,
http://www.mikrocontroller.net/topic/147150
it looks like there are three behaviors that could be better:
1. If malloc is called and there is only parts of the memory free, empty gaps arise without need:
void * a = s_malloc(34);
a = s_realloc(a, 10);
void * b = s_malloc(34);
Resulting in an unnecessary empty gap between between a and b.
2. If there is RAM for the Heap, which has been allocated and freed before, the next allocating goes from upper to lower addresses. This will IMHO be bad for realloc calls, because the memory behind will most likely be used, resulting in gaps if the memory size decreases and memory copies if increased.
3. There have been cases found where malloc claims not to have any memory free, which is wrong.
All three issues can be created with the attached sample.
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
Depends on the following items: None found
Items that depend on this one: None found
Follow 6 latest changes.