module GirFFI::AllocationHelper

Public Class Methods

safe_malloc(size) click to toggle source
# File lib/gir_ffi/allocation_helper.rb, line 5
def self.safe_malloc size
  ptr = LibC.malloc size
  raise NoMemoryError if ptr.null?
  ptr
end