返回一个指向变量或对象变量的指针。
因为pointerof使用了指针 ,所以它是不安全的。
sizeof(Int64) #=> 8
对于引用类型 ,大小等于指针的大小。
返回一个类的实例的大小。
class Point
def initialize(@x, @y)
Point.new 1, 2
# 2 x Int32 = 2 x 4 = 8
crystal允许声明这种变量
This is unsafe code and is almost always used in low-level code for declaring uninitialized StaticArray buffers without a performance penalty:
buffer = uninitialized UInt8[256]
The type after the uninitialized keyword follows the type grammar.