Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Problems with rb_struct_define and 64 bit Ruby
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel Berger  
View profile  
 More options Jun 8 2006, 1:02 am
From: "Daniel Berger" <djber...@gmail.com>
Date: Thu, 8 Jun 2006 14:02:47 +0900
Local: Thurs, Jun 8 2006 1:02 am
Subject: Problems with rb_struct_define and 64 bit Ruby

Hi all,

Ruby 1.8.4, 64 bit, built with --enable-pthread - no other special options
Suse Linux 9.3

It's late and I'm tired, so maybe I'm doing something dumb here, but this
code segfaults:

/* foo.c */
#include "ruby.h"
VALUE v_my_struct;

void Init_foo(){
   v_my_struct =
      rb_struct_define("MyStruct", "fee", "fi", "fo", "alpha", "beta",
"gamma", 0);

}

# extconf.rb
require 'mkmf'
create_makefile('foo')

# test.rb
$:.unshift Dir.pwd
require 'foo'

Take away any one member, and it works.  Any more than five and it
segfaults.  What gives?

Thanks,

Dan


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ts  
View profile  
 More options Jun 8 2006, 3:20 am
From: ts <dec...@moulon.inra.fr>
Date: Thu, 8 Jun 2006 16:20:54 +0900
Local: Thurs, Jun 8 2006 3:20 am
Subject: Re: Problems with rb_struct_define and 64 bit Ruby

>>>>> "D" == Daniel Berger <djber...@gmail.com> writes:

D>       rb_struct_define("MyStruct", "fee", "fi", "fo", "alpha", "beta",
D> "gamma", 0);

   ^^^^^^^^^^

   "gamma", NULL);

D> }

  ...

Guy Decoux


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Austin Ziegler  
View profile  
 More options Jun 8 2006, 5:52 pm
From: "Austin Ziegler" <halosta...@gmail.com>
Date: Fri, 9 Jun 2006 06:52:01 +0900
Local: Thurs, Jun 8 2006 5:52 pm
Subject: Re: Problems with rb_struct_define and 64 bit Ruby
On 6/8/06, ts <dec...@moulon.inra.fr> wrote:

> >>>>> "D" == Daniel Berger <djber...@gmail.com> writes:
> D>       rb_struct_define("MyStruct", "fee", "fi", "fo", "alpha", "beta",
> D> "gamma", 0);

>    ^^^^^^^^^^

>    "gamma", NULL);

> D> }

Gah. That's one of the things that I absolutely *despise* about C as
opposed to C++. I *like* that I can use 0 as if it were the same thing
as NULL and not (void*)0.

-austin
--
Austin Ziegler * halosta...@gmail.com
               * Alternate: aus...@halostatue.ca


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ts  
View profile  
 More options Jun 9 2006, 3:58 am
From: ts <dec...@moulon.inra.fr>
Date: Fri, 9 Jun 2006 16:58:01 +0900
Local: Fri, Jun 9 2006 3:58 am
Subject: Re: Problems with rb_struct_define and 64 bit Ruby

>>>>> "A" == Austin Ziegler <halosta...@gmail.com> writes:

A> Gah. That's one of the things that I absolutely *despise* about C as
A> opposed to C++. I *like* that I can use 0 as if it were the same thing
A> as NULL and not (void*)0.

 Well, the architecture x86_64 was created to make in sort that C
 programmer understand the difference between (int)0 and (void *)0

 :-)

Guy Decoux


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google