Ejemplo n.º 1
0
    public void Setup()
    {
        OldMode = NativeLeakDetection.Mode;

        // Should have stack trace with tests
        NativeLeakDetection.Mode = NativeLeakDetectionMode.EnabledWithStackTrace;
    }
    public virtual void Setup()
    {
        // Ensure we have full stack traces when running tests.
        OldLeakMode = NativeLeakDetection.Mode;
        NativeLeakDetection.Mode = NativeLeakDetectionMode.EnabledWithStackTrace;

        if (World != null)
        {
            return;
        }

        World = DefaultWorldInitialization.Initialize("Test World");
        DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(World, DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default));
    }
Ejemplo n.º 3
0
        private static void CreateInternal(ref DisposeSentinel sentinel, int callSiteStackDepth)
        {
            NativeLeakDetectionMode mode = NativeLeakDetection.Mode;
            bool flag = mode == NativeLeakDetectionMode.Disabled;

            if (!flag)
            {
                ProfilerUnsafeUtility.BeginSample(DisposeSentinel.s_CreateProfilerMarkerPtr);
                StackTrace stackTrace = null;
                bool       flag2      = mode == NativeLeakDetectionMode.EnabledWithStackTrace;
                if (flag2)
                {
                    stackTrace = new StackTrace(callSiteStackDepth + 2, true);
                }
                sentinel = new DisposeSentinel
                {
                    m_StackTrace = stackTrace,
                    m_IsCreated  = 1
                };
                ProfilerUnsafeUtility.EndSample(DisposeSentinel.s_CreateProfilerMarkerPtr);
            }
        }
 public static extern void SetLeakDetectionMode(NativeLeakDetectionMode value);