Greetings,
Is there anything known about a possible Ruby-1.6.8 bug, where Array.new
starts returning nil ?
I have a class that starts like this:
class Awkstack < Array
@@sharedtext = nil
attr_reader :lastrub
def initialize(left)
@left = left
@CurrentDictStack = Array.new
if ! @CurrentDictStack
count = 0
ObjectSpace.each_object { count += 1 }
debug "#{count} objects"
ObjectSpace.garbage_collect
sleep 5
count = 0
ObjectSpace.each_object { count += 1 }
debug “#{count} objects”
@CurrentDictStack = Array.new
exit unless @CurrentDictStack
end
debug "init: #{object_id} #{@CurrentDictStack.object_id}"
end
end-of-code
After a certain amount of processing this process dies, first indicating
about 93000 objects, 5 seconds later some 60000. The process is about 11 Mb
in size. Different machines, differnet libc’s and different Linux kernels.
Ruby 1.6.8 out of the box, no extensions of my own, only extension not in
ruby core is REXML-2.5.7.
It runs fine under 1.8.0, so it’s not a project stopper, but I’m of course
curious.
Cheers,
Han Holl
I see you are inheiriting from Array, but you don’t call super.
Aren’t you suppose to call super here ???
···
On Wed, 09 Apr 2003 03:23:46 +0000, Han Holl wrote:
class Awkstack < Array
@@sharedtext = nil
attr_reader :lastrub
def initialize(left)
@left = left
@CurrentDictStack = Array.new
if ! @CurrentDictStack
count = 0
ObjectSpace.each_object { count += 1 }
debug “#{count} objects”
ObjectSpace.garbage_collect
sleep 5
count = 0
ObjectSpace.each_object { count += 1 }
debug “#{count} objects”
@CurrentDictStack = Array.new
exit unless @CurrentDictStack
end
debug “init: #{object_id} #{@CurrentDictStack.object_id}”
end
end-of-code
–
Simon Strandgaard
“Simon Strandgaard” 0bz63fz3m1qt3001@sneakemail.com wrote in message news:pan.2003.04.09.10.26.26.885195@sneakemail.com…
···
On Wed, 09 Apr 2003 03:23:46 +0000, Han Holl wrote:
I see you are inheiriting from Array, but you don’t call super.
Aren’t you suppose to call super here ???
I think ruby provides one if you omit it. Anyway I tried with
super(0), and it made no difference.
Still dies in 1.6.8 and runs fine on 1.8.0
Thanke for trying, though.
Cheers,
Han Holl