MemorySourceMemoryWrapper

class Wrapper

MessagePack factory wrapper for serializing allocations. Registers custom types for efficient serialization of allocation data.

Definitions

def initialize(cache)

Initialize the wrapper with a cache.

Signature

parameter cache Cache

The cache to use for allocation metadata.

Implementation

def initialize(cache)
	super()
	
	@cache = cache
	
	self.register_type(0x01, Allocation,
		packer: ->(instance){self.pack(instance.pack)},
		unpacker: ->(data){Allocation.unpack(@cache, self.unpack(data))},
	)
	
	self.register_type(0x02, Symbol)
end