Subject:
Re: [ruby-ffi] Re: Struct/ManagedStruct and GC behaviour
From:
Wayne Meissner
Date:
12/22/09 6:27 PM
To:
ruby-ffi@googlegroups.com

2009/12/23 rogerdpack <rogerpack2005@gmail.com>:
>> Yes, the backing memory is allocated by Struct.new
>
> Question. Is it zero initialized?

yes.

MemoryPointer.new and Buffer.new also zero initialize their contents,
unless you tell them not to.
e.g.
MemoryPointer.new :int  # allocates space for one int, zero initialized
MemoryPointer.new :int, 1  # allocates space for one int, zero initialized
MemoryPointer.new :int, 1, false  # allocates space for one int, _NOT_
zero initialized