예제 #1
0
		internal int add(object o)
		{
			int objIndex = cache.add(o);
			if (isGcObject(o))
			{
				objMap[o] = objIndex;
			}
			return objIndex;
		}
예제 #2
0
        internal int add(object o)
        {
            int objIndex = cache.add(o);

            if (isGcObject(o))
            {
                objMap[o] = objIndex;
                                #if SLUA_DEBUG || UNITY_EDITOR
                objNameDebugs[o] = getDebugName(o);
                                #endif
            }
            return(objIndex);
        }
예제 #3
0
        internal int add(IntPtr l, object o)
        {
            int objIndex = cache.add(o);

            if (isGcObject(o))
            {
                objMap[o] = objIndex;
                if (SLuaSetting.Instance.IsDebug)
                {
                    string s1 = string.Empty, s2 = string.Empty;
                    if (SLuaSetting.Instance.RecordObjectStackTrace)
                    {
                        s1 = Environment.StackTrace;
                        s2 = Logger.GetLuaStackTrack(l, "add");
                    }
                    objNameDebugs[o] = new string[] { getDebugName(objIndex, o) + DateTime.Now.ToString(" (HH-mm-ss-fff)"), s1, s2 };
                }
            }
            return(objIndex);
        }
예제 #4
0
파일: ObjectCache.cs 프로젝트: bmanGH/slua
        internal int add(object o)
        {
            int objIndex = cache.add(o);

            if (isGcObject(o))
            {
                objMap[o] = objIndex;
            }

#if LUA_OBJECT_CACHE_TRACE
            LuaDLL.lua_getglobal(_l, "debug");
            LuaDLL.lua_getfield(_l, -1, "traceback");
            LuaDLL.lua_call(_l, 0, 1);
            LuaDLL.lua_remove(_l, -2);
            string s = LuaDLL.lua_tostring(_l, -1);
            LuaDLL.lua_pop(_l, 1);

            _cacheTrace.Add(objIndex, s);
            _cacheTypeName.Add(objIndex, o.GetType().Name);
#endif

            return(objIndex);
        }