Skip to content
Permalink
Browse files
Merge pull request #9707 from JosJuice/remove-atomic-header
Remove Atomic.h
  • Loading branch information
lioncash committed May 14, 2021
2 parents 16e9117 + b93983b commit 964fed7
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 319 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -2,7 +2,6 @@ add_library(common
Analytics.cpp
Analytics.h
Assert.h
Atomic.h
BitField.h
BitSet.h
BitUtils.h
@@ -221,10 +221,10 @@ class PointerWrap
template <typename T>
void Do(std::atomic<T>& atomic)
{
T temp = atomic.load();
T temp = atomic.load(std::memory_order_relaxed);
Do(temp);
if (mode == MODE_READ)
atomic.store(temp);
atomic.store(temp, std::memory_order_relaxed);
}

template <typename T>
@@ -5,11 +5,13 @@
#pragma once

#include <array>
#include <atomic>
#include <string>
#include <tuple>
#include <type_traits>

#include "Common/Assert.h"
#include "Common/BitUtils.h"
#include "Common/CommonTypes.h"
#include "Core/ConfigManager.h"
#include "Core/HW/MMIOHandlers.h"
@@ -79,17 +81,19 @@ inline u16* LowPart(u32* ptr)
{
return (u16*)ptr;
}
inline u16* LowPart(volatile u32* ptr)
inline u16* LowPart(std::atomic<u32>* ptr)
{
return (u16*)ptr;
static_assert(std::atomic<u32>::is_always_lock_free && sizeof(std::atomic<u32>) == sizeof(u32));
return LowPart(Common::BitCast<u32*>(ptr));
}
inline u16* HighPart(u32* ptr)
{
return LowPart(ptr) + 1;
}
inline u16* HighPart(volatile u32* ptr)
inline u16* HighPart(std::atomic<u32>* ptr)
{
return LowPart(ptr) + 1;
static_assert(std::atomic<u32>::is_always_lock_free && sizeof(std::atomic<u32>) == sizeof(u32));
return HighPart(Common::BitCast<u32*>(ptr));
}
} // namespace Utils

@@ -49,7 +49,6 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule:
#include <cmath>
#include <cstdlib>

#include "Common/Atomic.h"
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
#include "Common/Thread.h"
@@ -16,9 +16,6 @@
<ClInclude Include="Common\Align.h" />
<ClInclude Include="Common\Analytics.h" />
<ClInclude Include="Common\Assert.h" />
<ClInclude Include="Common\Atomic_GCC.h" />
<ClInclude Include="Common\Atomic_Win32.h" />
<ClInclude Include="Common\Atomic.h" />
<ClInclude Include="Common\BitField.h" />
<ClInclude Include="Common\BitSet.h" />
<ClInclude Include="Common\BitUtils.h" />
@@ -11,7 +11,6 @@
#include <memory>
#include <string>

#include "Common/Atomic.h"
#include "Common/CommonTypes.h"
#include "Common/GL/GLContext.h"
#include "Common/GL/GLUtil.h"

0 comments on commit 964fed7

Please sign in to comment.