[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Inline C and Memory

Andrew Arrow

6/29/2007 3:54:00 AM

So the more objects you store in ruby the longer mark and sweep takes
for GC because there are more objects to iterate over. Makes sense.

If you have a machine with 8 gigs of RAM and want to fill up all the
memory to take advantage of it, can you will Ruby and Inline C?

So, the example Inline C looks like:

require 'rubygems'
require 'inline'

class Example
inline(:C) do |builder|
builder.c "int method_test1() {
int x = 10;
return x;
}"
end
end

p Example.new.method_test1

But would it be possible inside method_test1 to do complex memory
allocation and use all 8 gigs of RAM without all the ruby marking and
sweeping?

Thanks.

--
Posted via http://www.ruby-....