This is a very simple gem that exposes "sizeof" to Ruby to enable
checking size of primitive types like :float, :unsigned_int, and so
forth. I needed this for a parser I was writing, (I didn't feel like
writing the whole thing in C), couldn't find a way to do it without an
extension, and saw no reason not to publish the code afterward.
I hope I didn't just reinvent something that already exists in core Ruby
-- but I couldn't find it if it does, no matter how hard I Googled.
Cool. It would be nice to add the C99 type names, like int8, uint32, etc..
Cheers,
Ammar
路路路
On Wed, Oct 27, 2010 at 4:17 PM, Colin Mackenzie iv <sinisterchipmunk@gmail.com> wrote:
I've just released a new gem called "sizes".
This is a very simple gem that exposes "sizeof" to Ruby to enable
checking size of primitive types like :float, :unsigned_int, and so
forth. I needed this for a parser I was writing, (I didn't feel like
writing the whole thing in C), couldn't find a way to do it without an
extension, and saw no reason not to publish the code afterward.
I hope I didn't just reinvent something that already exists in core Ruby
-- but I couldn't find it if it does, no matter how hard I Googled.
This is a very simple gem that exposes "sizeof" to Ruby to enable
checking size of primitive types like :float, :unsigned_int, and so
forth. I needed this for a parser I was writing, (I didn't feel like
writing the whole thing in C), couldn't find a way to do it without an
extension, and saw no reason not to publish the code afterward.
I hope I didn't just reinvent something that already exists in core Ruby
-- but I couldn't find it if it does, no matter how hard I Googled.