Subject: [ruby-ffi] Re: LibC.malloc buffer |
From: Wayne Meissner |
Date: 9/25/12 4:59 PM |
To: ruby-ffi@googlegroups.com |
Hi,
when i create a FFI::Pointer object by LibC.malloc(8096) i get
/usr/local/lib/ruby/gems/1.9.1/gems/rsml-0.1/lib/rsml/sml_ file.rb:54: [BUG] Segmentation fault
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
Then i checked the buffer size.
p "buffer size: #{buffer.size}" =====> "buffer size: 9223372036854775807"
Why the buffer size is so big? How i can get a buffer width length of 8096 bytes?
I will rewrite
unsigned char buffer[8096];
Thanks for help