<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPCXpresso IDEのトピックRe: Stack and heap allocation checking LPC1114</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544110#M8563</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CodeRedSupport on Thu Sep 29 07:05:23 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Assuming&amp;nbsp; that you are using LPCXpresso 4, then depending upon what you are actually trying to do, you may find the section on "Heap allocation/checking" in the following FAQ of use...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/redlib_v2_notes&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRedSupport.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 01:52:33 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T01:52:33Z</dc:date>
    <item>
      <title>Stack and heap allocation checking LPC1114</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544106#M8559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JSalisbury on Thu Jul 14 03:49:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the best way of checking the stack and heap allocation in my C code for the LPC1114? Are there any tools that could assist with this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:52:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544106#M8559</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Stack and heap allocation checking LPC1114</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544107#M8560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jharwood on Fri Jul 15 22:10:24 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe not completely accurate, but near enough: is to use memory 'painting'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the ResetISR() function within the C run-time startup code, fill the memory from the end of the .bss section up to the top of RAM with a pattern value. Perhaps something like: {0xD, 0xE, 0xA, 0xD, 0xC, 0x0, 0xD, 0xE} if done with 32-bit words.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, when you want to check memory usage, start at the top of RAM, working your way down, look for two (or more) contiguous occurrences of the pattern value. That will pin-point the stack "high water mark". (or "low water mark" if you want to think of it that way)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Continue down from there, looking for two (or more) contiguous non-occurrences of the pattern. That would pin-point the top of the heap. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would probably have to make a point of always initializing heap allocations to all zeroes so that recent allocations would clear the painting pattern.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTH, james&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:52:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544107#M8560</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Stack and heap allocation checking LPC1114</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544108#M8561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by StephenHawkings on Sat Jul 16 04:42:33 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;There's an example included, which is called "stackusage". It contains also information about heap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\nxp\LPCXpresso_4.0.5_123\lpcxpresso\Examples\NXP\LPC1000\LPC11xx\NXP_LPCXpresso1114-302_2011-02-07\stackusage&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SH&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:52:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544108#M8561</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Stack and heap allocation checking LPC1114</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544109#M8562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rompacz on Thu Sep 29 02:19:33 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have similar question. I want to control memory alocation after using malloc() function. Do you know how to do it? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can imagine something like that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; memory_left_1=function();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;malloc(200); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;memory_left_2=function();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After that,&amp;nbsp; memory_left_2 would be 200 bytes less than memory_left_1. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In stack usage example, it is possible only to control the stack size. In my case, I need to control the heap size, I guess.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:52:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544109#M8562</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Stack and heap allocation checking LPC1114</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544110#M8563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CodeRedSupport on Thu Sep 29 07:05:23 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Assuming&amp;nbsp; that you are using LPCXpresso 4, then depending upon what you are actually trying to do, you may find the section on "Heap allocation/checking" in the following FAQ of use...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://support.code-red-tech.com/CodeRedWiki/redlib_v2_notes&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRedSupport.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:52:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Stack-and-heap-allocation-checking-LPC1114/m-p/544110#M8563</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:52:33Z</dc:date>
    </item>
  </channel>
</rss>

