Exemplo n.º 1
0
        /// <summary>
        /// 分配一个对象
        /// </summary>
        /// <param name="value">初始值</param>
        /// <returns></returns>
        public static VarDicSO Alloc(Dictionary <string, object> value)
        {
            VarDicSO var = Alloc();

            var.Value = value;
            return(var);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 分配一个对象
        /// </summary>
        /// <returns></returns>
        public static VarDicSO Alloc()
        {
            Instance = ReferencePool.Acquire <VarDicSO>();

            if (Instance.Value == null)
            {
                Instance.Value = new Dictionary <string, object>();
            }
            Instance.Value.Clear();
            return(Instance);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 回收对象
 /// </summary>
 /// <param name="value">初始值</param>
 /// <returns></returns>
 public static void Retrieve()
 {
     ReferencePool.Release(Instance);
     Instance = null;
 }