Running clang-format on alloy.
All except x64_sequences, which needs work.
This commit is contained in:
@@ -13,11 +13,10 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
using namespace alloy;
|
||||
namespace alloy {
|
||||
|
||||
|
||||
Memory::Memory() :
|
||||
membase_(0), reserve_address_(0) {
|
||||
Memory::Memory() : membase_(0), reserve_address_(0) {
|
||||
// TODO(benvanik): move to poly.
|
||||
#if XE_LIKE_WIN32
|
||||
SYSTEM_INFO si;
|
||||
GetSystemInfo(&si);
|
||||
@@ -27,12 +26,9 @@ Memory::Memory() :
|
||||
#endif
|
||||
}
|
||||
|
||||
Memory::~Memory() {
|
||||
}
|
||||
Memory::~Memory() {}
|
||||
|
||||
int Memory::Initialize() {
|
||||
return 0;
|
||||
}
|
||||
int Memory::Initialize() { return 0; }
|
||||
|
||||
void Memory::Zero(uint64_t address, size_t size) {
|
||||
uint8_t* p = membase_ + address;
|
||||
@@ -50,15 +46,14 @@ void Memory::Copy(uint64_t dest, uint64_t src, size_t size) {
|
||||
XEIGNORE(xe_copy_memory(pdest, size, psrc, size));
|
||||
}
|
||||
|
||||
uint64_t Memory::SearchAligned(
|
||||
uint64_t start, uint64_t end,
|
||||
const uint32_t* values, size_t value_count) {
|
||||
uint64_t Memory::SearchAligned(uint64_t start, uint64_t end,
|
||||
const uint32_t* values, size_t value_count) {
|
||||
XEASSERT(start <= end);
|
||||
const uint32_t *p = (const uint32_t*)(membase_ + start);
|
||||
const uint32_t *pe = (const uint32_t*)(membase_ + end);
|
||||
const uint32_t* p = (const uint32_t*)(membase_ + start);
|
||||
const uint32_t* pe = (const uint32_t*)(membase_ + end);
|
||||
while (p != pe) {
|
||||
if (*p == values[0]) {
|
||||
const uint32_t *pc = p + 1;
|
||||
const uint32_t* pc = p + 1;
|
||||
size_t matched = 1;
|
||||
for (size_t n = 1; n < value_count; n++, pc++) {
|
||||
if (*pc != values[n]) {
|
||||
@@ -74,3 +69,5 @@ uint64_t Memory::SearchAligned(
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace alloy
|
||||
|
||||
Reference in New Issue
Block a user