class MachInfo::MachArrayPtrConvertor(T)

Overview

Pointer Helper Class This class performs some memory management for out array pointers. The convertor ensures we dont leak kernel memory, but copying the array to our own pointer, and calling vm_deallocate back on the orignal pointer, yes this is a copy and used more ram than needed, but it ensures vm alocated memory is properly freed.

Defined in:

mach/types.cr

Class Method Summary

Class Method Detail

def self.cast_to(ptr : LibC::ArrayPtr) #

cast routine will ensure the passed in pointer is de-allocated and a copy made for the return value


[View source]
def self.cast_to_array(ptr : LibC::ArrayPtr, length : Int = 0) #

[View source]