<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>When should I use nrf_calloc (malloc) instead static var?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44062/when-should-i-use-nrf_calloc-malloc-instead-static-var</link><description>When should I use nrf_calloc (malloc) instead of static declared variable on nrf52840 chip. I mean it has a huge ram memory for as much static declared variables as I would want ever. So my thinking about dynamic memory allocation: 
 So should I use this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Feb 2019 14:52:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44062/when-should-i-use-nrf_calloc-malloc-instead-static-var" /><item><title>RE: When should I use nrf_calloc (malloc) instead static var?</title><link>https://devzone.nordicsemi.com/thread/173076?ContentTypeID=1</link><pubDate>Tue, 26 Feb 2019 14:52:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbebe91d-e97b-4e69-9142-d0cd673ae515</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the bad link. We at support don&amp;#39;t recommend using dynamic memory allocation since there is a high risk of getting issues related to unsafe allocation algorithm or fragmentation. &amp;quot;Don&amp;#39;t use at all nowadays&amp;#39;, is the way to go!&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When should I use nrf_calloc (malloc) instead static var?</title><link>https://devzone.nordicsemi.com/thread/172913?ContentTypeID=1</link><pubDate>Tue, 26 Feb 2019 03:14:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99f4aa51-fbd5-4d41-9073-047960fe7916</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Hi. Thanks for answer. I can&amp;#39;t open second thread you linked to, says &amp;quot;it&amp;#39;s private get out of here&amp;quot;)).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From first thread If understand correctly use nrf_calloc or nrf_malloc instead of native C functions (calloc, malloc) technically will not bring any problem with fragmentation and memory leak.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But the main question is&lt;/p&gt;
&lt;p&gt;If I am sure I don&amp;#39;t approach even half of whole nrf52840 ram should I think about dynamic allocation (nrf_calloc)?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When should I use nrf_calloc (malloc) instead static var?</title><link>https://devzone.nordicsemi.com/thread/172737?ContentTypeID=1</link><pubDate>Mon, 25 Feb 2019 12:25:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fc08ab7-f4be-4c03-af56-2fac4e25b08c</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The usage of dynamic allocation has been discussed before in this forum. I suggest that you see the answers in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43632/nrf52-modules-stop-working-after-weeks/171380#171380"&gt;this &lt;/a&gt;thread and this.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>