1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-23 18:18:00 +02:00

Fixed Event<T> when allocator doesn't align (64-bit)

This commit is contained in:
Brian Fiete 2022-07-27 13:46:08 -04:00
parent fc07561044
commit 837184e674
2 changed files with 12 additions and 5 deletions

View file

@ -13,10 +13,17 @@ namespace System
// If we are enumerating then mData points to the enumerator.
int mData;
#if BF_64_BIT
const int sIsEnumerating = (.)0x8000'0000'0000'0000;
const int sHadEnumRemoves = 0x4000'0000'0000'0000;
const int sFlagsMask = (.)0xC000'0000'0000'0000;
const int sDataMask = ~sFlagsMask;
#else
const int sIsEnumerating = 1;
const int sHadEnumRemoves = 2;
const int sFlagsMask = 3;
const int sDataMask = ~sFlagsMask;
#endif
public bool HasListeners
{

View file

@ -21,18 +21,18 @@ ValuePointer = "/*(mMethodId < 0) ? &this :*/ __cast(\"_BF_DeferredData_\", mMet
[[Type]]
Name = "System.Event<*>"
DisplayString = "{{ data={__cast(\"System.Object\", mData & ~3)} }}"
DisplayString = "{{ data={__cast(\"System.Object\", mData & sDataMask)} }}"
[[Type.Expand.Item]]
Name = "[target]"
Value = "__cast(\"System.Object\", mData)"
Condition = "(mData & 1) == 0"
Condition = "(mData & sIsEnumerating) == 0"
[[Type.Expand.Item]]
Name = "[target]"
Value = "((System.Event<$T1>.Enumerator*)(mData & ~3)).mTarget"
Condition = "(mData & 1) != 0"
Value = "((System.Event<$T1>.Enumerator*)(mData & sDataMask)).mTarget"
Condition = "(mData & sIsEnumerating) != 0"
[[Type.Expand.Item]]
Name = "[flags]"
Value = "mData & 3"
Value = "mData & sFlagsMask"
[[Type]]
Name = "_BF_DeferredData_*"