public static LongBuffer Wrap(long[] data) { LongBuffer buf = new LongBuffer(new byte[data.Length * 8], 0, data.Length * 8); for (int i = 0; i < data.Length; i++) { buf.PutLong(data[i]); } return buf; }
public MersenneTwisterData() { // index a value in 'state' // the array for the state vector ByteBuffer buff = ByteBuffer.AllocateDirect(MT_N * 8); buff.Order(ByteBuffer.NativeOrder()); state = buff.AsLongBuffer(); state.Clear(); state.Position(0); state.Limit(MT_N); }
public virtual void Compact() { if (TJS.IsLowMemory) { mSourcePosArray = null; } }
public LongBuffer AsLongBuffer() { LongBuffer buf = new LongBuffer(); buf.buffer = new byte[this.buffer.Length]; this.buffer.CopyTo(buf.buffer, 0); buf.c = this.c; buf.capacity = this.capacity; buf.index = this.index; buf.limit = this.limit; buf.mark = this.mark; buf.offset = this.offset; buf.order = this.order; return buf; }
public InterCodeObject(ScriptBlock block, string name, int type, short[] code, Variant [] da, int varcount, int verrescount, int maxframe, int argcount, int arraybase, int colbase, bool srcsorted, LongBuffer srcpos, int[] superpointer) : base(GetContextHashSize (type)) { //super.mCallFinalize = false; mBlock = block; //mBlock.add( this ); mName = name; mContextType = type; mCode = code; mDataArray = da; mMaxVariableCount = varcount; mVariableReserveCount = verrescount; mMaxFrameCount = maxframe; mFuncDeclArgCount = argcount; mFuncDeclUnnamedArgArrayBase = arraybase; mFuncDeclCollapseBase = colbase; //mSourcePosArraySorted = srcsorted; mSourcePosArray = srcpos; mSuperClassGetterPointer = superpointer; }