示例#1
0
        public static int PopMyStringSize(this ContextDataSlots context)
        {
            context.TryGetNamedDataSlot("_mystring", out object stackVal);
            var stack = (Stack <int>)stackVal;

            return(stack.Pop());
        }
示例#2
0
        public static void PushMyStringSize(this ContextDataSlots context, int len)
        {
            if (!context.TryGetNamedDataSlot("_mystring", out object stackVal))
            {
                stackVal = new Stack <int>();
                context.AllocateNamedDataSlot("_mystring", stackVal);
            }

            var stack = (Stack <int>)stackVal;

            stack.Push(len);
        }
示例#3
0
 public static void SetMyStringStack(this ContextDataSlots context, ContextDataSlots target)
 {
     context.TryGetNamedDataSlot("_mystring", out object stackVal);
     target.AllocateNamedDataSlot("_mystring", stackVal);
 }