- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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.
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?
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Les
many thanks Les
![](/skins/images/DF2E495CEC88D713A66401CF495CD875/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page