Ejemplo n.º 1
0
            /// <summary>
            /// Adds a new trap for the specified memory region. Does nothing
            /// if a region with the same starting address is already trapped.
            /// </summary>
            /// <param name="trapStart">The starting address of the region.</param>
            /// <param name="trapLength">The length of the region.</param>
            /// <param name="trapHandler">The delegate to call when the memory
            /// is written.</param>
            public void Add(int trapStart, int trapLength, MemoryTrapHandler trapHandler)
            {
                int idx = starts.BinarySearch(trapStart);

                if (idx < 0)
                {
                    idx = ~idx;
                    starts.Insert(idx, trapStart);
                    lengths.Insert(idx, trapLength);
                    handlers.Insert(idx, trapHandler);
                }
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a new trap for the specified memory region. Does nothing
 /// if a region with the same starting address is already trapped.
 /// </summary>
 /// <param name="trapStart">The starting address of the region.</param>
 /// <param name="trapLength">The length of the region.</param>
 /// <param name="trapHandler">The delegate to call when the memory
 /// is written.</param>
 public void Add(int trapStart, int trapLength, MemoryTrapHandler trapHandler)
 {
     int idx = starts.BinarySearch(trapStart);
     if (idx < 0)
     {
         idx = ~idx;
         starts.Insert(idx, trapStart);
         lengths.Insert(idx, trapLength);
         handlers.Insert(idx, trapHandler);
     }
 }