示例#1
0
    public void AllocateType()
    {
        var ctx   = CreateContext();
        var frame = ctx.Execute((generator, o) => generator.Emit(OpCodes.RET));
        var obj   = IshtarGC.AllocTypeInfoObject(T.STRING, frame);

        IshtarGC.FreeObject(&obj, frame);
    }
示例#2
0
    public void AllocateField()
    {
        var ctx   = CreateContext();
        var frame = ctx.Execute((generator, o) => generator.Emit(OpCodes.RET));
        var obj   = IshtarGC.AllocFieldInfoObject(T.STRING.Field["Length"], frame);

        new IshtarLayerField(obj, frame);
        IshtarGC.FreeObject(&obj, frame);
    }
示例#3
0
    public void AllocateMethod()
    {
        var ctx   = CreateContext();
        var frame = ctx.Execute((generator, o) => generator.Emit(OpCodes.RET));
        var obj   = IshtarGC.AllocMethodInfoObject(T.STRING.Method["op_Equal(String,String)"], frame);
        var fn    = new IshtarLayerFunction(obj, frame);

        Assert.AreEqual("op_Equal", fn.Name);
        IshtarGC.FreeObject(&obj, frame);
    }
示例#4
0
        public unsafe void CorrectAllocateString()
        {
            var result = IshtarMarshal.ToIshtarObject("foo");

            IshtarGC.FreeObject(&result, new CallFrame());
        }
示例#5
0
        public unsafe void CorrectAllocateObject()
        {
            var result = IshtarGC.AllocObject(VeinTypeCode.TYPE_I8.AsRuntimeClass());

            IshtarGC.FreeObject(&result, new CallFrame());
        }