Sha256: 5bb0e153a2511a5f0faa192705abbfca06c6001c20ac90fcc356335cdb8c0c3f

Contents?: true

Size: 273 Bytes

Versions: 9

Compression:

Stored size: 273 Bytes

Contents

# frozen_string_literal: true

require 'gir_ffi/lib_c'

module GirFFI
  # Helper module for alloction-related functionality.
  module AllocationHelper
    def self.free_after(ptr)
      result = yield ptr
      LibC.free ptr unless ptr.null?
      result
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.14.1 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.14.0 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.13.1 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.13.0 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.12.1 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.12.0 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.11.4 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.11.3 lib/gir_ffi/allocation_helper.rb
gir_ffi-0.11.2 lib/gir_ffi/allocation_helper.rb