2019-08-23 11:56:54 -07:00
|
|
|
namespace System
|
|
|
|
{
|
2019-10-09 16:16:01 -07:00
|
|
|
[AlwaysInclude]
|
|
|
|
struct Pointer : IHashable
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
2019-10-09 16:16:01 -07:00
|
|
|
void* mVal;
|
2019-08-23 11:56:54 -07:00
|
|
|
|
2019-10-09 16:16:01 -07:00
|
|
|
public int GetHashCode()
|
|
|
|
{
|
|
|
|
return (int)mVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
[AlwaysInclude]
|
|
|
|
Object GetBoxed()
|
|
|
|
{
|
|
|
|
return new box this;
|
|
|
|
}
|
2020-06-03 12:05:49 -07:00
|
|
|
|
|
|
|
public override void ToString(String strBuffer)
|
|
|
|
{
|
|
|
|
strBuffer.AppendF("0x{0:P}", (uint)(void*)mVal);
|
|
|
|
}
|
2019-08-23 11:56:54 -07:00
|
|
|
}
|
|
|
|
|
2019-10-09 16:16:01 -07:00
|
|
|
struct Pointer<T> : IHashable
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
|
|
|
T* mVal;
|
2019-10-09 16:16:01 -07:00
|
|
|
|
|
|
|
public int GetHashCode()
|
|
|
|
{
|
2019-11-19 09:58:35 -08:00
|
|
|
return (int)(void*)mVal;
|
2019-10-09 16:16:01 -07:00
|
|
|
}
|
2020-06-03 12:05:49 -07:00
|
|
|
|
|
|
|
public override void ToString(String strBuffer)
|
|
|
|
{
|
|
|
|
strBuffer.Append("(");
|
|
|
|
typeof(T).GetFullName(strBuffer);
|
|
|
|
strBuffer.AppendF("*)0x{0:P}", (uint)(void*)mVal);
|
|
|
|
}
|
2019-08-23 11:56:54 -07:00
|
|
|
}
|
|
|
|
}
|