gobo-eiffel / gobo

The Gobo Eiffel Project provides the Eiffel community with free and portable Eiffel tools and libraries.
https://sourceforge.net/projects/gobo-eiffel/
Other
59 stars 24 forks source link

gec: no internal GC? so the gec compiled program can only alloc memory, but never release? #42

Closed mw66 closed 4 years ago

mw66 commented 4 years ago

Hi, I saw this:

http://www.gobosoft.com/eiffel/gobo/gec/limitations.html

Garbage Collection no internal GC, the Boehm GC can be plugged instead

so the gec compiled program can only alloc memory, but never release memory?

Or can one manually free memory from the program?

ebezault commented 4 years ago

Eiffel does not allow manual memory management. So with no GC the memory is never released. This is OK for applications which do not produce too much "garbage". This is the case for the tools provided in the Gobo package. For more advanced applications, it is recommended to use the Boehm GC. I use it for my projects at work, and it's working fine. You will have to install the Boehm GC on your machine:

Home page: http://hboehm.info/gc/ Download from: http://hboehm.info/gc/gc_source/

On Windows I use the makefile NT_X64_STATIC_THREADS_MAKEFILE (slightly modified to add the C and C++ compilation flags -DLARGE_CONFIG and -DATOMIC_UNCOLLECTABLE) with the command nmake nodebug=1. Then I set the environment variable BOEHM_GC to point to the folder containing the subfolder 'include'. See details in the .cfg files in $GOBO/tool/gec/config/c. From there, you should use the gec option: gec --gc=boehm ....

mw66 commented 4 years ago

Thank you for the explanation, I will take a look.