Esempio n. 1
0
        /// <summary>
        ///		Get an item by item key (which is the start of the associated range)
        /// </summary>
        /// <param name="rangeKey">
        ///		The item key value
        /// </param>
        /// <returns>
        ///		<code>default(V)</code> item with the specified <paramref name="rangeKey"/> does not exist in the collection
        /// </returns>
        public V GetExact(K rangeKey)
        {
            V retval = default(V);

            _dictionary.Find(rangeKey, out retval);
            return(retval);
        }
Esempio n. 2
0
        private void AddCLRRegions(ClrRuntime runtime)
        {
            foreach (var region in runtime.EnumerateMemoryRegions())
            {
                // We don't need reserved memory in our dump
                if (region.Type == ClrMemoryRegionType.ReservedGCSegment)
                {
                    continue;
                }

                ulong address    = region.Address;
                ulong endAddress = region.Address + region.Size;
                ulong existingEndAddress;
                if (_majorClrRegions.Find(ref address, out existingEndAddress))
                {
                    _majorClrRegions.Update(region.Address, Math.Max(existingEndAddress, endAddress));
                }
                else
                {
                    _majorClrRegions.Add(region.Address, endAddress);
                }
            }
        }