public static int PopMyStringSize(this ContextDataSlots context) { context.TryGetNamedDataSlot("_mystring", out object stackVal); var stack = (Stack <int>)stackVal; return(stack.Pop()); }
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); }
public static void SetMyStringStack(this ContextDataSlots context, ContextDataSlots target) { context.TryGetNamedDataSlot("_mystring", out object stackVal); target.AllocateNamedDataSlot("_mystring", stackVal); }