<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>dynamic memory</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/35050/dynamic-memory</link><description> 
hello, (NXP 1768 with RTX) 
i will use dynamic memory (heap size : 0x5120=20768) in my
project. 
project allocate differente size in function of configuration. 

 
i count the size allocate heap use = (size want + 4 byte
pointer) 

 

 infocenter.arm</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: dynamic memory</title><link>https://community.arm.com/thread/121313?ContentTypeID=1</link><pubDate>Fri, 13 Apr 2018 01:59:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:84e5e127-68df-447c-be1e-3c4503bf7c97</guid><dc:creator>thibaud ravel</dc:creator><description>&lt;p&gt;&lt;p&gt;
at start no free.&lt;br /&gt;
higher pointer is 0x10007138 is case &lt;b&gt;2&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
in this case &lt;b&gt;1&lt;/b&gt;: higher is 0x10004520&lt;/p&gt;

&lt;p&gt;
can&amp;#39;t alloc 32 bytes malloc return 0.&lt;/p&gt;

&lt;p&gt;
11K between two adress.&lt;/p&gt;

&lt;p&gt;
why he return NULL, heap is not full (for me), i can allocate at
0x10007138...&lt;/p&gt;

&lt;p&gt;
can you explain this?&lt;/p&gt;

&lt;p&gt;
is possible to have source code of malloc keil to understand?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dynamic memory</title><link>https://community.arm.com/thread/109481?ContentTypeID=1</link><pubDate>Fri, 13 Apr 2018 01:56:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4d28ce3a-b8a5-47ad-86d6-a0efb4eb6fd7</guid><dc:creator>thibaud ravel</dc:creator><description>&lt;p&gt;&lt;p&gt;
at start no free.&lt;br /&gt;
higher pointer is 0x10007138 is case 1&lt;/p&gt;

&lt;p&gt;
in this case 2: higher is 0x10004520&lt;/p&gt;

&lt;p&gt;
can&amp;#39;t alloc 32 bytes malloc return 0.&lt;/p&gt;

&lt;p&gt;
11K between two adress.&lt;/p&gt;

&lt;p&gt;
why he return NULL, heap is not full (for me), i can allocate at
0x10007138...&lt;/p&gt;

&lt;p&gt;
can you explain this?&lt;/p&gt;

&lt;p&gt;
is possible to have source code of malloc keil to understand?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dynamic memory</title><link>https://community.arm.com/thread/94392?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 23:23:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a5b18519-81ec-4d7d-928d-677f9d811055</guid><dc:creator>thibaud ravel</dc:creator><description>&lt;p&gt;&lt;p&gt;
l understand but it&amp;#39;s very hight diference,&lt;/p&gt;

&lt;p&gt;
15k with alloc struct 5* struct1 and alloc 1 struct1 and 1
struct2, can&amp;#39;t be alloc more 5k.&lt;/p&gt;

&lt;p&gt;
10k lost or alloc less than 5*struct1...&lt;/p&gt;

&lt;p&gt;
it&amp;#39;s difficult to understand...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dynamic memory</title><link>https://community.arm.com/thread/86323?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 08:22:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eeb19d08-9074-420f-963b-64212e165cfb</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt;&amp;gt;i count the size allocate heap use = (size want + 4 byte
pointer)&lt;/p&gt;

&lt;p&gt;
Pretty sure the allocator has more overhead, and must be
aligned.&lt;/p&gt;

&lt;p&gt;
Fragmentation and resource leaks can also diminish resources.&lt;/p&gt;

&lt;p&gt;
Unused/freed memory blocks will also continue to use resources
especially when they can be folded into each other.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>