Exemple #1
0
        bool ILuaAPI.CheckStack(int size)
        {
            bool res = false;

            if (StackLast - Top.Index > size)
            {
                res = true;
            }
            // need to grow stack
            else
            {
                int inuse = Top.Index + LuaDef.EXTRA_STACK;
                if (inuse > LuaConf.LUAI_MAXSTACK - size)
                {
                    res = false;
                }
                else
                {
                    var param = new GrowStackParam();
                    param.L    = this;
                    param.size = size;
                    res        = D_RawRunProtected(DG_GrowStack, ref param) == ThreadStatus.LUA_OK;
                }
            }

            if (res && CI.TopIndex < Top.Index + size)
            {
                CI.TopIndex = Top.Index + size; // adjust frame top
            }
            return(res);
        }
Exemple #2
0
        bool ILuaAPI.CheckStack(int size)
        {
            bool res = false;

            if(StackLast - Top.Index > size)
                { res = true; }
            // need to grow stack
            else {
                int inuse = Top.Index + LuaDef.EXTRA_STACK;
                if(inuse > LuaConf.LUAI_MAXSTACK - size)
                    res = false;
                else {
                    var param = new GrowStackParam();
                    param.L = this;
                    param.size = size;
                    res = D_RawRunProtected(DG_GrowStack, ref param)==ThreadStatus.LUA_OK;
                }
            }

            if(res && CI.TopIndex < Top.Index + size)
                CI.TopIndex = Top.Index + size; // adjust frame top

            return res;
        }
Exemple #3
0
 private static void GrowStackWrap(ref GrowStackParam param)
 {
     param.L.GrowStack(param.size);
 }
Exemple #4
0
 private static void GrowStackWrap(ref GrowStackParam param)
 {
     param.L.GrowStack(param.size);
 }