Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > defining allocate is deprecated; use rb_define_alloc_func instead

Reply
Thread Tools

defining allocate is deprecated; use rb_define_alloc_func instead

 
 
Brian Takita
Guest
Posts: n/a
 
      10-30-2010
Hello, I'm trying to upgrade RR to Ruby 1.9.2.

I'm getting the following warning:

warning: defining StrongSpecFixture.allocate is deprecated; use
rb_define_alloc_func()

Is there a way to redefine allocate in Ruby in a way that works across
all of the different Ruby implementations (JRuby, Rubinius, etc)?

Thank you,
Brian

 
Reply With Quote
 
 
 
 
Charles Oliver Nutter
Guest
Posts: n/a
 
      11-19-2010
On Sat, Oct 30, 2010 at 6:07 PM, Brian Takita <(E-Mail Removed)> wrote:
> Hello, I'm trying to upgrade RR to Ruby 1.9.2.
>
> I'm getting the following warning:
>
> warning: defining StrongSpecFixture.allocate is deprecated; use
> rb_define_alloc_func()
>
> Is there a way to redefine allocate in Ruby in a way that works across
> all of the different Ruby implementations (JRuby, Rubinius, etc)?


Not really. Most impls, including MRI and JRuby, don't actually
dispatch to allocate when constructing a new object, so there's no way
to replace it at runtime. This is done partially for performance
reasons, and partially (at least in JRuby's case) because allocate
initializes impossible-to-initialize-any-other-way internal state for
the object, so replacing it would be a bad thing.

JRuby 1.6 does provide a solid start on a compatible C API, though, so
if it's native-level allocate binding you need, that's an option. And
of course there's impl-specific ways to do this entirely from Ruby
code in JRuby and probably others.

- Charlie

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of Static Variables from Outside of Defining Class Chris Portka C++ 3 12-06-2006 02:23 AM
Random Colors For Use In Defining Different Regions Adam Hartshorne C++ 12 01-28-2006 09:52 PM
Cant get router (DHCP) to allocate ip =?Utf-8?B?bWFyYw==?= Wireless Networking 27 12-28-2005 04:06 PM
rb_define_alloc_func() Charles Mills Ruby 0 07-12-2004 07:38 PM
defining or not defining destructors johny smith C++ 8 07-02-2004 08:51 AM



Advertisments