System.Internal.DebugHandleTracker.HandleType.Add C# (CSharp) Method

Add() public method

public Add ( IntPtr handle ) : void
handle System.IntPtr
return void
            public void Add(IntPtr handle) {
                lock(this) {
                    int hash = ComputeHash(handle);
                    if (CompModSwitches.HandleLeak.Level >= TraceLevel.Info) {
                        Debug.WriteLine("-------------------------------------------------");
                        Debug.WriteLine("Handle Allocating: " + Convert.ToString((int)handle, 16));
                        Debug.WriteLine("Handle Type      : " + name);
                        if (CompModSwitches.HandleLeak.Level >= TraceLevel.Verbose)
                            Debug.WriteLine(Environment.StackTrace);
                    }

                    HandleEntry entry = buckets[hash];
                    while (entry != null) {
                        Debug.Assert(entry.handle != handle, "Duplicate handle of type " + name);
                        entry = entry.next;
                    }

                    buckets[hash] = new HandleEntry(buckets[hash], handle);

                    handleCount++;
                }
            }