Exemple #1
0
void Store::getUnlocked(uint32_t id, char* block) const {
  if (fill_page_cache_) {
    fill_page_cache_ = false;
    // Touch each block to load it into the OS page cache.
    const auto num_blocks_mapped = mapped_.getNumBlocks(getBlockSize());
    for (uint32_t i = 0; i != num_blocks_mapped; ++i) {
      std::memcpy(block, getAddressOf(i), getBlockSize());
    }
  }
  std::memcpy(block, getAddressOf(id), getBlockSize());
}
Exemple #2
0
  LLValue *put(DValue *v) override {
    LLValue *address = getAddressOf(v);

    LLType *abiTy = getAbiType(v->getType());
    assert(abiTy && "Why are we rewriting a non-rewritten type?");

    return loadFromMemory(address, abiTy, ".X86_64_C_struct_rewrite_putResult");
  }
	const std::vector<unsigned char> getDataSerialization(T& data)
	{
		auto pData = reinterpret_cast<unsigned char*>(getAddressOf(data));
		std::vector<unsigned char> result;
		result.resize(sizeof(T));
		for (std::vector<unsigned char>::size_type i = 0; i < result.size(); i++)
		{
			result[i] = pData[i];
		}
		return result;
	}
Exemple #4
0
 LLValue *put(DValue *v) override { return getAddressOf(v); }
Exemple #5
0
 LLValue* put(Type* dty, DValue* v) {
     assert(dty == v->getType());
     return getAddressOf(v);
 }
Exemple #6
0
 LLValue* put(DValue* v) {
     return getAddressOf(v);
 }
Exemple #7
0
void Store::replaceUnlocked(uint32_t id, const char* block) {
  MT_REQUIRE_NOT_NULL(block);
  std::memcpy(getAddressOf(id), block, getBlockSize());
}