mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 07:51:28 +12:00
utils::shm: Make map_self() atomic (#9578)
This commit is contained in:
parent
e1f95ceb54
commit
c50b9bc4b4
2 changed files with 18 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "util/types.hpp"
|
||||
#include "util/atomic.hpp"
|
||||
|
||||
namespace utils
|
||||
{
|
||||
|
@ -52,7 +53,7 @@ namespace utils
|
|||
#endif
|
||||
u32 m_size;
|
||||
u32 m_flags;
|
||||
void* m_ptr;
|
||||
atomic_t<void*> m_ptr;
|
||||
|
||||
public:
|
||||
explicit shm(u32 size, u32 flags = 0);
|
||||
|
@ -84,7 +85,7 @@ namespace utils
|
|||
// Get memory mapped by map_self()
|
||||
u8* get() const
|
||||
{
|
||||
return reinterpret_cast<u8*>(m_ptr);
|
||||
return static_cast<u8*>(+m_ptr);
|
||||
}
|
||||
|
||||
u32 size() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue