Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package;
- using SizeOf;
- import io.Bytes;
- import haxe.macro.Context;
- import haxe.macro.Expr;
- import haxe.macro.TypeTools;
- #if !macro @:genericBuild(InlineArrayBuilder.build()) #end
- class InlineArray<T> extends ReadOnlyBufferSlice {
- }
- interface IInlineArray<T> {
- public function sizeOf () : Int;
- }
- class ReadOnlyBufferSlice
- {
- public final buffer : ReadOnlyMemory;
- public final offset : Int;
- public final length : Int;
- public inline function new(buffer, offset, length) {
- if (offset < 0) throw "Idiot";
- this.buffer = buffer;
- this.offset = offset;
- this.length = length;
- }
- }
Add Comment
Please, Sign In to add comment