Dave Aronson wrote in post #1034307:
> On Mon, Nov 28, 2011 at 21:08, Tridib Bandopadhyay <tridib04 / gmail.com>
> wrote:
>
>> I am able to implement manual memory management in Ruby.I can allocate
>> and deallocate the object by myself but The Garbage collector is not
>> marking nor allocating the object, but its creating the object.
>
> I don't get what you mean.

I am trying to allow the user to manually allocate and free memory
whenever they want to.

>
> First off, why would you *want* to allocate and deallocate memory
> manually?  This is Ruby, not C, you don't have to do that.  Having to
> keep track of stuff like that manually, is why I was so happy to leave
> C behind!

I learned from a paper based on Java that if we implement manual
deallocation of objects along with Garbage Collection then it can
improve the performance by 30%. So i am trying to implement the same
scenario in Ruby.

>
> Second, what do you mean by "creating the object" if it's not
> "allocating the object"?  Maybe you mean setting the fields, but since
> memory hasn't been allocated it's trying to do it at address zero, or
> some address that's whatever random garbage happened to be in the
> pointer?

Creating the Object means-- I debugged some print statement inside
rb_newobj() method in gc.c file to check when the new object is defined.
So I can see that statement of mine.

Tridib Bandopadhyay

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