Sharon Rosner
unread,Feb 16, 2008, 4:20:00 AM2/16/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ambition.rb
Hi all
I just found out that the ruby2ruby of Proc#to_sexp leaks memory, and
browsing the ambition source code t looks the ambition implementation
of the same method will also leak memory because methods are being
added to the ProcHolder class but are never removed. In Sequel we have
a different implementation that might be a little slower (though I
didn't run any benchmarks) but nevertheless removes the memory leak:
class Proc
def to_sexp
block = self
c = Class.new {define_method(:m, &block)}
body = ParseTree.translate(c, :m)[2][1..-1]
[:proc, *body]
end
end
I couldn't find anywhere to open a ticket, so I'm reporting it here
FYI.
best
sharon