[*] Linux build regressions

This commit is contained in:
Reece Wilson 2024-03-21 00:28:50 +00:00
parent ac3b317fa3
commit c87ec4e4b6
5 changed files with 15 additions and 42 deletions

View File

@ -19,11 +19,11 @@ namespace __audetail
{
if (pThat)
{
pThat->PrivateUserDataToUtilityMutex()->Lock();
AuAtomicAdd(&pThat->uInUseCounter, 1u);
this->StrongLoad();
pThat->PrivateUserDataToUtilityMutex()->Lock();
AURORA_COMPILER_VOLATILE_BARRIER();
}
}
@ -36,18 +36,6 @@ namespace __audetail
pThat->PrivateUserDataToUtilityMutex()->Unlock();
}
}
private:
#pragma optimize("", off)
void StrongLoad()
{
// Strict load now. After this point, the compiler can lazy load with using these loads in its' emitted code or via the CPU cache
// It would be nice to make these properly volatile without impacting our other high perf paths, somehow
pIDC = AuAtomicLoad(&pThat->base);
pIDC = AuAtomicLoad(&pThat->readPtr);
pIDC = AuAtomicLoad(&pThat->writePtr);
}
#pragma optimize("", on)
};
struct BufferAllocLock
@ -60,9 +48,9 @@ namespace __audetail
{
if (pThat)
{
this->StrongLoad();
pThat->PrivateUserDataToUtilityMutex()->Lock();
AURORA_COMPILER_VOLATILE_BARRIER();
}
}
@ -73,18 +61,6 @@ namespace __audetail
pThat->PrivateUserDataToUtilityMutex()->Unlock();
}
}
private:
#pragma optimize("", off)
void StrongLoad()
{
// Strict load now. After this point, the compiler can lazy load with using these loads in its' emitted code or via the CPU cache
// It would be nice to make these properly volatile without impacting our other high perf paths, somehow
pIDC = AuAtomicLoad(&pThat->base);
pIDC = AuAtomicLoad(&pThat->readPtr);
pIDC = AuAtomicLoad(&pThat->writePtr);
}
#pragma optimize("", on)
};
}

View File

@ -67,6 +67,12 @@
#define AUKN_INTERFACE_EXT AUI_INTERFACE_EXT_FWD
#endif
#if defined(MemoryBarrier)
#define AURORA_COMPILER_VOLATILE_BARRIER() MemoryBarrier()
#else
#define AURORA_COMPILER_VOLATILE_BARRIER() asm volatile ("" : : : "memory")
#endif
#include "Memory/Memory.hpp"
#include "Utility/PrivData.hpp"

View File

@ -24,7 +24,7 @@ namespace Aurora::IO::Loop
ELoopSource GetType() override;
bool AddOne() override;
bool AddMany(AuUInt32 uCount);
bool AddMany(AuUInt32 uCount) override;
virtual bool OnTrigger(AuUInt handle) override;

View File

@ -11,7 +11,7 @@
namespace Aurora::Memory
{
DeletableHeap::DeletableHeap(Heap *parent, void *ptr) :
DeletableHeap::DeletableHeap(Heap *pParent, void *ptr) :
pParent(pParent),
ptr2_(ptr)
{

View File

@ -108,15 +108,6 @@ namespace Aurora::Threading
this->Release();
}
static void FlushWaitBufferPAddressCache()
{
#if defined(MemoryBarrier)
MemoryBarrier();
#else
asm volatile ("" : : : "memory");
#endif
}
template <EWaitMethod eMethod>
bool WaitEntry::SleepOn(WaitState &state)
{
@ -240,7 +231,7 @@ namespace Aurora::Threading
bool WaitBuffer::Compare(const void *pHotAddress, AuUInt8 uSize, const void *pCompare, AuUInt64 uMask, EWaitMethod eMethod)
{
bool bRet {};
FlushWaitBufferPAddressCache();
AURORA_COMPILER_VOLATILE_BARRIER();
#if 0
switch (eMethod)
@ -270,7 +261,7 @@ namespace Aurora::Threading
template <EWaitMethod eMethod, bool bFast>
bool WaitBuffer::Compare2(const void *pHot, AuUInt8 uSize, const void *pBuf2, AuUInt64 uMask)
{
FlushWaitBufferPAddressCache();
AURORA_COMPILER_VOLATILE_BARRIER();
if constexpr (!bFast)
{