Module: Sodium::Mprotect

Extended by:
FFI::Library
Defined in:
lib/sodium/mprotect.rb

Class Method Summary collapse

Class Method Details

.noaccess(ptr) ⇒ Object



15
16
17
# File 'lib/sodium/mprotect.rb', line 15

def noaccess(ptr)
  sodium_mprotect_noaccess(ptr) == 0 || raise(MemoryError, "Memory at address=#{ptr.address} is not secured with Sodium.malloc", caller)
end

.readonly(ptr) ⇒ Object



19
20
21
# File 'lib/sodium/mprotect.rb', line 19

def readonly(ptr)
  sodium_mprotect_readonly(ptr) == 0 || raise(MemoryError, "Memory at address=#{ptr.address} is not secured with Sodium.malloc", caller)
end

.readwrite(ptr) ⇒ Object



23
24
25
# File 'lib/sodium/mprotect.rb', line 23

def readwrite(ptr)
  sodium_mprotect_readwrite(ptr) == 0 || raise(MemoryError, "Memory at address=#{ptr.address} is not secured with Sodium.malloc", caller)
end