Class: LIBUSB::Transfer::ZeroCopyMemory
- Inherits:
-
FFI::Pointer
- Object
- FFI::Pointer
- LIBUSB::Transfer::ZeroCopyMemory
- Defined in:
- lib/libusb/transfer.rb
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #free(id = nil) ⇒ Object
-
#initialize(pDevhandle, ptr, size) ⇒ ZeroCopyMemory
constructor
A new instance of ZeroCopyMemory.
Constructor Details
#initialize(pDevhandle, ptr, size) ⇒ ZeroCopyMemory
Returns a new instance of ZeroCopyMemory.
31 32 33 34 35 |
# File 'lib/libusb/transfer.rb', line 31 def initialize(pDevhandle, ptr, size) @pDevhandle = pDevhandle @size = size super(ptr) end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
29 30 31 |
# File 'lib/libusb/transfer.rb', line 29 def size @size end |
Instance Method Details
#free(id = nil) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/libusb/transfer.rb', line 37 def free(id=nil) # puts format("libusb_dev_mem_free(%#x, %d)%s", address, @size||0, id ? " by GC" : '') return unless @size res = Call.libusb_dev_mem_free( @pDevhandle, self, @size ) LIBUSB.raise_error res, "in libusb_dev_mem_free" if res!=0 @size = nil end |