//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
using System.GCs;
using System.Runtime.CompilerServices;
namespace System {
///
/// Abstraction for information about the stack height. This is currently
/// only used by the logging undo code for determining if a pointer write
/// occurred in stack space allocated after the tryall section began.
///
/// StackHeight does not record information about the call stack.
///
/// The current implementation is hardwired to a stack model where the stack
/// is a single contiguous piece of memory that grows by putting smaller
/// values into the stack pointer.
///
[RequiredByBartok]
public struct StackHeight {
///
/// Interpret the pointer as a stack pointer to determine the stack
/// height.
///
/// Pointer into the stack.
/// The stack height of the location pointed to by the
/// argument.
public StackHeight(UIntPtr stackPointer);
///
/// Interpret the pointer as a stack pointer to determine the stack
/// height.
///
/// Pointer into the stack.
/// The stack height of the location pointed to by the
/// argument.
public static explicit operator StackHeight(UIntPtr stackPointer);
///
/// Get the current stack height.
///
/// The current stack height.
//[Intrinsic]
// [MethodImplAttribute(MethodImplOptions.PublicCall)]
public static StackHeight GetStackHeight();
///
/// Check if the first stack height represents a deeper location on the
/// stack.
///
/// The first stack height to compare.
/// The second stack height to compare.
/// True iff the first height is deeper in the stack than the
/// second height.
public static bool Deeper(StackHeight first, StackHeight second);
///
/// The value of the stack pointer when the stack height was taken.
///
private UIntPtr stackPointer;
}
}