Method: Fiddle::CUnionEntity.malloc
- Defined in:
- lib/fiddle/struct.rb
.malloc(types, func = nil) ⇒ Object
Allocates a C union the types provided.
When the instance is garbage collected, the C function func is called.
216 217 218 219 |
# File 'lib/fiddle/struct.rb', line 216 def CUnionEntity.malloc(types, func=nil) addr = Fiddle.malloc(CUnionEntity.size(types)) CUnionEntity.new(addr, types, func) end |