Guest User

Untitled

a guest
Jul 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. package;
  2. using SizeOf;
  3. import io.Bytes;
  4. import haxe.macro.Context;
  5. import haxe.macro.Expr;
  6. import haxe.macro.TypeTools;
  7.  
  8. #if !macro @:genericBuild(InlineArrayBuilder.build()) #end
  9. class InlineArray<T> extends ReadOnlyBufferSlice {
  10. }
  11.  
  12. interface IInlineArray<T> {
  13. public function sizeOf () : Int;
  14. }
  15.  
  16. class ReadOnlyBufferSlice
  17. {
  18. public final buffer : ReadOnlyMemory;
  19. public final offset : Int;
  20. public final length : Int;
  21.  
  22. public inline function new(buffer, offset, length) {
  23. if (offset < 0) throw "Idiot";
  24. this.buffer = buffer;
  25. this.offset = offset;
  26. this.length = length;
  27. }
  28. }
Add Comment
Please, Sign In to add comment