<?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 Mixing c++ and Fortran dynamic allocation at runtime in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixing-c-and-Fortran-dynamic-allocation-at-runtime/m-p/890231#M78014</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a project divided in many libraries and dlls.Some are written in c++, some other in Fortran. Whai I would like to understand is if there can be problems by managing dynamic memory (allocate - deallocate, new - delete) with both c++ and Fortran at runtime.&lt;/P&gt;
&lt;P&gt;Some Fortran DLL includes a c++ static library which allocates and deallocates some data which is used by fortran code. This could generate memory leaks? or c runtimes has no problems with fortran runtimes? does the RTL of different languages manages the same heap or does they create a separate Heap for c++ and fortran RTL?&lt;/P&gt;
&lt;P&gt;The only rule I follow is to set DLL (multithread) runtime libraries for both c++ and Fortran and to avoid mixed language allocations/deallocations (I mean, If I allocate y with 'new' in c++ I will deallocate it with delete in c++, not with DELETE in fortran). Is this enought or there are some other important rules to keep in mind when mixing languages?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Dec 2008 14:41:14 GMT</pubDate>
    <dc:creator>Roberto_Sartori</dc:creator>
    <dc:date>2008-12-03T14:41:14Z</dc:date>
    <item>
      <title>Mixing c++ and Fortran dynamic allocation at runtime</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixing-c-and-Fortran-dynamic-allocation-at-runtime/m-p/890231#M78014</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a project divided in many libraries and dlls.Some are written in c++, some other in Fortran. Whai I would like to understand is if there can be problems by managing dynamic memory (allocate - deallocate, new - delete) with both c++ and Fortran at runtime.&lt;/P&gt;
&lt;P&gt;Some Fortran DLL includes a c++ static library which allocates and deallocates some data which is used by fortran code. This could generate memory leaks? or c runtimes has no problems with fortran runtimes? does the RTL of different languages manages the same heap or does they create a separate Heap for c++ and fortran RTL?&lt;/P&gt;
&lt;P&gt;The only rule I follow is to set DLL (multithread) runtime libraries for both c++ and Fortran and to avoid mixed language allocations/deallocations (I mean, If I allocate y with 'new' in c++ I will deallocate it with delete in c++, not with DELETE in fortran). Is this enought or there are some other important rules to keep in mind when mixing languages?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2008 14:41:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixing-c-and-Fortran-dynamic-allocation-at-runtime/m-p/890231#M78014</guid>
      <dc:creator>Roberto_Sartori</dc:creator>
      <dc:date>2008-12-03T14:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing c++ and Fortran dynamic allocation at runtime</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixing-c-and-Fortran-dynamic-allocation-at-runtime/m-p/890232#M78015</link>
      <description>&lt;DIV style="margin:0px;"&gt;As long as you keep to your rule you should be ok.&lt;BR /&gt;I have many mixed language exes and libraries,and a lot of array allocation and re-allocation done in Fortran without problem including passing arrays between languages.&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;There should be no memory leaks from fortran allocations - unless there is a compiler bug :-) C and C++ allocations however need to be watched.&lt;/DIV&gt;
&lt;P&gt;Les&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2008 15:14:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixing-c-and-Fortran-dynamic-allocation-at-runtime/m-p/890232#M78015</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2008-12-03T15:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing c++ and Fortran dynamic allocation at runtime</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixing-c-and-Fortran-dynamic-allocation-at-runtime/m-p/890233#M78016</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/126388"&gt;Les Neilson&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;As long as you keep to your rule you should be ok.&lt;BR /&gt;I have many mixed language exes and libraries,and a lot of array allocation and re-allocation done in Fortran without problem including passing arrays between languages.&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;There should be no memory leaks from fortran allocations - unless there is a compiler bug :-) C and C++ allocations however need to be watched.&lt;/DIV&gt;
&lt;P&gt;Les&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;many thanks Les&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2008 15:38:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixing-c-and-Fortran-dynamic-allocation-at-runtime/m-p/890233#M78016</guid>
      <dc:creator>Roberto_Sartori</dc:creator>
      <dc:date>2008-12-03T15:38:53Z</dc:date>
    </item>
  </channel>
</rss>

