Changeset fc4de9ec in OpenModelica


Ignore:
Timestamp:
2016-04-08T13:28:41+02:00 (8 years ago)
Author:
hudson <openmodelica@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
0d11bbe
Parents:
fd246e86
git-author:
Martin Sjölund <martin.sjolund@…> (04/08/16 13:28:41)
git-committer:
hudson <openmodelica@…> (04/08/16 13:28:41)
Message:

Try to free data to collect front-end garbage

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 3rdParty

    • Property commit changed from c7218c58060db85f3c8763020e684b509456e4a0 to eb26945f0dbe869d81dcce0af9bb0491f93afcdd
  • Compiler/SimCode/SimCodeMain.mo

    r5e18b052 rfc4de9ec  
    788788      description = DAEUtil.daeDescription(dae);
    789789      dlow = BackendDAECreate.lower(dae, cache, graph, BackendDAE.EXTRA_INFO(description,filenameprefix));
     790
     791      GC.free(dae);
     792      graph = FCore.EG("<EMPTY>");
     793
    790794      //BackendDump.printBackendDAE(dlow);
    791       (dlow_1, initDAE, useHomotopy, initDAE_lambda0, removedInitialEquationLst, primaryParameters, allPrimaryParameters) = BackendDAEUtil.getSolvedSystem(dlow,inFileNamePrefix);
     795      (dlow, initDAE, useHomotopy, initDAE_lambda0, removedInitialEquationLst, primaryParameters, allPrimaryParameters) = BackendDAEUtil.getSolvedSystem(dlow,inFileNamePrefix);
    792796      timeBackend = System.realtimeTock(ClockIndexes.RT_CLOCK_BACKEND);
    793797
    794798      (libs, file_dir, timeSimCode, timeTemplates) =
    795         generateModelCode(dlow_1, initDAE, useHomotopy, initDAE_lambda0, removedInitialEquationLst, primaryParameters, allPrimaryParameters, p, className, filenameprefix, inSimSettingsOpt, args);
     799        generateModelCode(dlow, initDAE, useHomotopy, initDAE_lambda0, removedInitialEquationLst, primaryParameters, allPrimaryParameters, p, className, filenameprefix, inSimSettingsOpt, args);
    796800
    797801      resultValues = {("timeTemplates", Values.REAL(timeTemplates)),
     
    799803                      ("timeBackend", Values.REAL(timeBackend)),
    800804                      ("timeFrontend", Values.REAL(timeFrontend))};
    801     then (cache, st, dlow_1, libs, file_dir, resultValues);
     805    then (cache, st, dlow, libs, file_dir, resultValues);
    802806
    803807    case (_, _, _, _, _, _, _, _) equation
  • Compiler/Util/GC.mo

    r7e8eeef2 rfc4de9ec  
    5050function free<T>
    5151  input T data;
    52 external "C" GC_free(data) annotation(Library = {"omcgc"});
     52external "C" omc_GC_free_ext(data) annotation(Include="
     53void omc_GC_free_ext(void *data)
     54{
     55  /*  */
     56  GC_free(MMC_UNTAGPTR(data));
     57}
     58",
     59  Library = {"omcgc"}, Documentation(info="<html>
     60<p>GC_free requires \"a pointer to the base of an object\".</p>
     61<p>So the object passed to free must not be allocated by any of the list
     62routines that allocate multiple elements with a single malloc call.</p>
     63<p>Calling GC.free is very dangerous. You might be better off trying to
     64set variables to a constant value if you want to GC them. Use this if
     65you are concerned about temporary variables, etc remaining on the stack
     66and not cleared for a long time.</p>
     67</html>"));
    5368end free;
    5469
Note: See TracChangeset for help on using the changeset viewer.