avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] [bug #27235] malloc: Several things go wrong


From: Malte
Subject: [avr-libc-dev] [bug #27235] malloc: Several things go wrong
Date: Wed, 12 Aug 2009 14:54:01 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.12) Gecko/2009072221 Iceweasel/3.0.6 (Debian-3.0.6-1)

URL:
  <http://savannah.nongnu.org/bugs/?27235>

                 Summary: malloc: Several things go wrong
                 Project: AVR C Runtime Library
            Submitted by: malte
            Submitted on: Wed 12 Aug 2009 02:54:00 PM GMT
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: libc code
                  Status: None
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.6.6
           Fixed Release: None

    _______________________________________________________

Details:

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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 12 Aug 2009 02:54:00 PM GMT  Name: tests.zip  Size: 17kB   By:
malte

<http://savannah.nongnu.org/bugs/download.php?file_id=18562>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27235>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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