chromium/v8/src/base/memory.h

// Copyright 2011 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_BASE_MEMORY_H_
#define V8_BASE_MEMORY_H_

#include "src/base/macros.h"

namespace v8 {
namespace base {

Address;

// Memory provides an interface to 'raw' memory. It encapsulates the casts
// that typically are needed when incompatible pointer types are used.
template <class T>
inline T& Memory(Address addr) {}
template <class T>
inline T& Memory(uint8_t* addr) {}

template <typename V>
static inline V ReadUnalignedValue(Address p) {}

template <typename V>
static inline V ReadUnalignedValue(const char p[sizeof(V)]) {}

template <typename V>
static inline void WriteUnalignedValue(Address p, V value) {}

template <typename V>
static inline void WriteUnalignedValue(char p[sizeof(V)], V value) {}

template <typename V>
static inline V ReadLittleEndianValue(Address p) {}

template <typename V>
static inline void WriteLittleEndianValue(Address p, V value) {}

template <typename V>
static inline V ReadLittleEndianValue(V* p) {}

template <typename V>
static inline void WriteLittleEndianValue(V* p, V value) {}

}  // namespace base
}  // namespace v8

#endif  // V8_BASE_MEMORY_H_