<?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>topic Is it possible to get a small in Analyzers</title>
    <link>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973091#M9535</link>
    <description>&lt;P&gt;Is it possible to get a small reproducer?&lt;/P&gt;
&lt;P&gt;This example works fine for me (compiled on Windows with Composer XE 2013, 64 bit):&lt;/P&gt;
&lt;P&gt;[fortran]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; program two_pointer&lt;BR /&gt;&amp;nbsp;&amp;nbsp; integer, pointer :: array1(:),array2(:)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; integer i&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; allocate(array1(100))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do i = 1,100&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array1(i) = i&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end do&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array2 =&amp;gt; array1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; deallocate(array2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end&lt;/P&gt;
&lt;P&gt;[/fortran]&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2013 22:06:05 GMT</pubDate>
    <dc:creator>Mark_D_Intel</dc:creator>
    <dc:date>2013-03-15T22:06:05Z</dc:date>
    <item>
      <title>Deallocation through a different pointer</title>
      <link>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973089#M9533</link>
      <description>&lt;P&gt;Has anyone figured out if Intel Inspector will get tricked if memory is deallocated through a different pointer than it was originally associated with? For example if I have a array pointer that I allocate space for, and fill, then I point another array pointer to the original pointer, and deallocate the memory by the new pointer? If I try to deallocate the old pointer I get run time errors, if I don't deallocate it the Inspector reports a memory leak. Is this really a leak? Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 21:09:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973089#M9533</guid>
      <dc:creator>Aaron_S_1</dc:creator>
      <dc:date>2013-03-15T21:09:14Z</dc:date>
    </item>
    <item>
      <title>By the way, I'm using the</title>
      <link>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973090#M9534</link>
      <description>&lt;P&gt;By the way, I'm using the Inspector on Fortran&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 21:14:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973090#M9534</guid>
      <dc:creator>Aaron_S_1</dc:creator>
      <dc:date>2013-03-15T21:14:10Z</dc:date>
    </item>
    <item>
      <title>Is it possible to get a small</title>
      <link>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973091#M9535</link>
      <description>&lt;P&gt;Is it possible to get a small reproducer?&lt;/P&gt;
&lt;P&gt;This example works fine for me (compiled on Windows with Composer XE 2013, 64 bit):&lt;/P&gt;
&lt;P&gt;[fortran]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; program two_pointer&lt;BR /&gt;&amp;nbsp;&amp;nbsp; integer, pointer :: array1(:),array2(:)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; integer i&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; allocate(array1(100))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do i = 1,100&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array1(i) = i&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end do&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array2 =&amp;gt; array1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; deallocate(array2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end&lt;/P&gt;
&lt;P&gt;[/fortran]&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 22:06:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973091#M9535</guid>
      <dc:creator>Mark_D_Intel</dc:creator>
      <dc:date>2013-03-15T22:06:05Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...I have a array pointer</title>
      <link>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973092#M9536</link>
      <description>&amp;gt;&amp;gt;...I have a array pointer that I allocate space for, and fill, then I point another array pointer to the original pointer, and
&amp;gt;&amp;gt;deallocate the memory by the new pointer?

It should work if pArray1[] == pArray2[]

&amp;gt;&amp;gt;If I try to deallocate the old pointer I get run time errors,

Your description looks right and it should work. However, it is Not clear how you've implemented codes and you could have some logical error when deallocating memory.

&amp;gt;&amp;gt;if I don't deallocate it the Inspector reports a memory leak. Is this really a leak?

Please see above.</description>
      <pubDate>Sat, 16 Mar 2013 21:53:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Deallocation-through-a-different-pointer/m-p/973092#M9536</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-03-16T21:53:00Z</dc:date>
    </item>
  </channel>
</rss>

