The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
ruby+objc, Part 2

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Laurent Sansonetti

Posts: 134
Nickname: lrz
Registered: Jun, 2006

Laurent Sansonetti is a software engineer at Apple Computer and a longtime Ruby enthusiast.
ruby+objc, Part 2 Posted: Dec 27, 2007 8:18 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Laurent Sansonetti.
Original Post: ruby+objc, Part 2
Feed Title: lrz's diary
Feed URL: http://www.chopine.be/lrz/diary/xml/rss/feed.xml
Feed Description: lrz's diary
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Laurent Sansonetti
Latest Posts From lrz's diary

Advertisement

ruby+objc (briefly introduced here, and yes I still need a better name) uses a new garbage collector, the same that has just been introduced with the new version of the Objective-C runtime in Leopard.

The collector is generational, and uses write barriers to filter modifications inside the object store and therefore quickly collect generations of young objects. The Ruby runtime was deeply modified to explicitly set the write barriers.

Collections can happen in a separate thread, which doesn't stop the execution of the main one. Due to the current nature of Ruby 1.9, on which ruby+objc is based upon, finalizers must acquire the giant lock though. Fortunately, only a couple of classes seem to require a finalizer (IO and some T_DATA classes).

Despite having a more reliable collector, this change is also very interesting because it means that both Ruby and Objective-C objects are now issued from the same memory pool, and managed by the same garbage collector.

(gdb) p (void *) [[NSObject new] zone]
$1 = (void *) 0x14ab000
(gdb) p (void *) [[RBRegexp new] zone]
$2 = (void *) 0x14ab000
(gdb) po NSZoneName(0x14ab000) 
auto_zone

More to come: some interesting benchmarks.

Read: ruby+objc, Part 2

Topic: Stay At Home Servers: Your Geek Christmas Present Previous Topic   Next Topic Topic: My Favorite gem Commands

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use