A collection of UInt8Array that's meant to be used as a typed array storage from an existing data.

Static variables

@:value(new IntMap())staticfinalread onlybuffers:Map<Int, UInt8Array> = new IntMap()

Static methods

staticget(data:Array<Int>):UInt8Array

Gets a buffer of specified length by data.length and fills it with data. Else one is created and added to the cache.

Use this to prevent wasteful allocations when creating multiple typed arrays of the same length that have the sole purpose of holding data.

For example, this function is used in FoxFramebuffer to write GPU texture data back to the CPU

	var buffer = UInt8BufferCache.get(data);

After that, we no longer need the buffer, so we can call get() again for the next uniform rather than letting it be garbage collected.

staticinlineclear():Void