Skip to content

Instantly share code, notes, and snippets.

@asterite
Created March 19, 2014 16:14
Show Gist options
  • Save asterite/9645235 to your computer and use it in GitHub Desktop.
Save asterite/9645235 to your computer and use it in GitHub Desktop.
class Object
def self.size
base = Pointer(self).null
(base + 1).address - base.address
end
end
struct Foo
def initialize(@x, @y, @z)
end
end
Foo.new(1, 2, 1.5)
puts Foo.size
puts Int32.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment