Module: LLVM::Support
- Defined in:
- lib/llvm/support.rb,
lib/llvm/core/value.rb
Defined Under Namespace
Modules: C
Class Method Summary collapse
Class Method Details
.allocate_pointers(size_or_values, &block) ⇒ Object
354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/llvm/core/value.rb', line 354 def allocate_pointers(size_or_values, &block) if size_or_values.is_a?(Integer) raise ArgumentError, 'block not given' unless block size = size_or_values values = (0...size).map { |i| yield i } else values = size_or_values size = values.size end FFI::MemoryPointer.new(:pointer, size).write_array_of_pointer(values) end |