Re: Edita on 4.0b3 (r3124)
- Posted by mattlewis (admin) Apr 05, 2010
- 1354 views
This becomes especially important when you start using delete routines, which are incredibly useful.
Tell me more. What are delete routines?
See the documentation for delete_routine() and delete(). Basically, they're a way to add the equivalent of a destructor (to use C++ terms) when a euphoria object is garbage collected. They only apply to atoms represented as doubles (integers are automatically promoted) or sequences. Some built-ins now use them, as well as some library code.
Take a look at allocate() for an example that automatically frees your pointer for you when the value is no longer referenced. open() also does this for you. Basically, you can do RAII in euphoria now. That's the main thing that drove the redesign of the refcount system. The regular expression data created by PCRE when you compile, etc, regular expressions is also released this way.
Both. Phix is actually 9x, bit slower with the problem, bit faster without, btw. The problem vanishes here under with trace as well. Try it without trace.
Aha. That did it. Also, without inline 'fixes' it as well. Though the slowdown for me is a little less than 2X. Looks like inlined function results need some work.
Matt