[*] af5c8e86c0 20hrs ago: AuSPtr<AuMemoryViewXXX>s werent fully eliminated

This commit is contained in:
Reece Wilson 2024-07-13 16:34:44 +01:00
parent 124e9d1d0a
commit 3d652ed605
6 changed files with 13 additions and 11 deletions

View File

@ -12,7 +12,7 @@ namespace Aurora::IO::Net
struct IDatagramServer : virtual ISocketBase
{
virtual void SendPacket(const NetEndpoint &destination,
const AuSPtr<AuMemoryViewRead> &pPacketData,
const AuMemoryViewRead &packetData,
const AuSPtr<AuAsync::PromiseCallback<AuNullS, NetError>> &pCalback) = 0;
virtual AuSPtr<IDatagramDriver> GetDatagramDriver() = 0;

View File

@ -55,8 +55,8 @@ namespace Aurora::IO::FS
bool Init(const AuSPtr<IIOHandle> &handle);
bool StartRead(AuUInt64 offset, const AuSPtr<AuMemoryViewWrite> &memoryView) override;
bool StartWrite(AuUInt64 offset, const AuSPtr<AuMemoryViewRead> &memoryView) override;
bool StartRead(AuUInt64 offset, const AuMemoryViewWrite &memoryView) override;
bool StartWrite(AuUInt64 offset, const AuMemoryViewRead &memoryView) override;
bool Complete() override;

View File

@ -52,14 +52,14 @@ namespace Aurora::IO::Net
}
void DatagramServer::SendPacket(const NetEndpoint &destination,
const AuSPtr<AuMemoryViewRead> &pPacketData,
const AuMemoryViewRead &packetData,
const AuSPtr<AuAsync::PromiseCallback<AuNullS, NetError>> &pCalback2)
{
AuSPtr<AuIO::IAsyncFinishedSubscriberFunctional> pCallback;
if (pCalback2)
{
pCallback = AuMakeShared<AuIO::IAsyncFinishedSubscriberFunctional>([uSourceLength = pPacketData->length,
pCallback = AuMakeShared<AuIO::IAsyncFinishedSubscriberFunctional>([uSourceLength = packetData.length,
pCalback2 = AuSPtr<AuAsync::PromiseCallback<AuNullS, NetError>>(pCalback2)](AuUInt64 uOffset, AuUInt32 uLength)
{
if (uSourceLength != uLength)
@ -99,7 +99,7 @@ namespace Aurora::IO::Net
pTransaction->SetCallback(pCallback);
if (!pTransaction->StartWrite(0, pPacketData))
if (!pTransaction->StartWrite(0, packetData))
{
NetError error;
NetError_SetCurrent(error);

View File

@ -14,7 +14,7 @@ namespace Aurora::IO::Net
struct DatagramServer : virtual SocketServerImpl, virtual IDatagramServer
{
void SendPacket(const NetEndpoint &destination,
const AuSPtr<AuMemoryViewRead> &pPacketData,
const AuMemoryViewRead &pPacketData,
const AuSPtr<AuAsync::PromiseCallback<AuNullS, NetError>> &pCalback) override;
DatagramServer(struct NetInterface *pInterface,

View File

@ -52,8 +52,8 @@ namespace Aurora::IO::UNIX
pinSelf = this->pin_;
pinMem = this->memPin_;
auto cp1 = context->readView;
auto cp2 = context->writeView;
auto cp1 = this->readView;
auto cp2 = this->writeView;
if (AuExchange(this->bIsReadPending, false))
{

View File

@ -25,8 +25,8 @@ namespace Aurora::IO::UNIX
bool LIOS_Cancel();
bool HasState();
void SetMemory(const AuSPtr<AuMemoryViewRead> &view);
void SetMemory(const AuSPtr<AuMemoryViewWrite> &view);
void SetMemory(const AuMemoryViewRead &view);
void SetMemory(const AuMemoryViewWrite &view);
AuUInt64 GetData();
AuUInt64 GetBuf();
@ -47,6 +47,8 @@ namespace Aurora::IO::UNIX
// TODO:
AuSPtr<void> pin_;
AuSPtr<void> memPin_;
AuMemoryViewRead readView;
AuMemoryViewWrite writeView;
private:
AuUInt64 dataPtr_ {};
AuUInt dataLen_ {};