When working with this class make sure to take into account that it is up to you to make sure that object life-time is properly managed. Especially, pay attention to the notes for β»οΈ and π.
Package
Initializers
Methods
Value Type π§
Represents a region in memory.
Working with π§ requires great care as this interface allows you to directly manipulate memory.
Itβs important to understand that instances of π§ are basically memory addresses. Always think of a π§ instance as pointing to a memory region. Because π§ instance always are addresses it is recommmended that you make no more copies than absolutely necessary to avoid unwanted side effects.
It is not possible to directly manipulate or access memory addresses as this would interfer with the automatic memory management Emojicode provides.
Initializers
Methods
π½β‘οΈ
β£οΈ β‘οΈ π½πTβͺοΈπ ππ₯‘ value T offset π’
Writes value starting offset bytes past the address represented by this instance.
If the memory area represented is smaller than βοΈT β offset
bytes, undefined behavior is caused!
π½βοΈ
β£οΈ βοΈ π½πTβͺοΈπ offset π’ β‘οΈ β΄οΈT
Reads a value of type T starting bytes bytes past the address represented by this instance.
If the memory area represented is smaller than βοΈT β offset
bytes, the behavior is undefined!
If the value at specified location is not exactly of type T or, in the case T is a class type, a subclass of T, the behavior is undefined!
πβοΈ
β£οΈ π βοΈ π newSize π’
Resizes this memory area.
Do not call this method if you have copies of this π§ , i.e. if you have multiple pointers to this area. Calling this method updates the represented address and can invalidate all other π§ that pointed to this address. Only ever call this method if there is only one π§ representing the memory area.
β»βοΈ
β£οΈ βοΈ β»πTβͺοΈπ offset π’
Releases a value of type T that is located offset bytes past the beginning of this memory area.
This method might not actually write to the memory, but it is crucial that you call it on every value that was placed in the memory area that you no longer need.
Release every value placed in the memory area with this method before overwritting it or entirely abandoning this π§ instance!
πβοΈ
β£οΈ βοΈ π destinationOffset π’ source π§ sourceOffset π’ bytes π’
Copies bytes bytes from source starting from sourceOffset to this instane, writing the copied bytes destinationOffset bytes past the beginning of this memory area.
source may be the same as the instance on which the method is called and the memory area which is copied may overlap the destination area.
If the memory area represented is smaller than bytes β destinationOffset
bytes or source is smaller than bytes β sourceOffset
bytes, undefined behavior is caused!
Do not copy managed values using this method! Copy each value individually with π½ and β‘οΈ π½!