Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def test(&block)
  2. GC.disable
  3. before_strings = ObjectSpace.each_object(String).to_a
  4.  
  5. yield
  6.  
  7. after_strings = ObjectSpace.each_object(String).to_a
  8.  
  9. p after_strings - before_strings
  10.  
  11.  
  12. GC.enable
  13. end
  14.  
  15. puts "Before"
  16.  
  17. ababa = ["test", 'hello', 'world']
  18.  
  19. test do
  20. "epic" * 20
  21. "longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong"
  22. "text"
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement