Lines Matching refs:address

298 EntryImpl::EntryImpl(BackendImpl* backend, Addr address, bool read_only)
302 entry_.LazyInit(backend->File(address), address);
411 memset(entry_store, 0, sizeof(EntryStore) * entry_.address().num_blocks());
417 node->contents = entry_.address().value();
423 Addr address(0);
424 if (!CreateBlock(entry_store->key_len + 1, &address))
427 entry_store->long_key = address.value();
428 File* key_file = GetBackingFile(address, kKeyFileIndex);
432 if (address.is_block_file())
433 offset = address.start_block() * address.BlockSize() + kBlockHeaderSize;
436 DeleteData(address, kKeyFileIndex);
440 if (address.is_separate_file())
484 Addr address(entry_.Data()->data_addr[index]);
485 if (address.is_initialized()) {
491 DeleteData(address, index);
504 Addr address(entry_.Data()->long_key);
505 DeleteData(address, kKeyFileIndex);
508 backend_->DeleteBlock(entry_.address(), true);
512 backend_->DeleteBlock(node_.address(), true);
521 void EntryImpl::SetNextAddress(Addr address) {
522 DCHECK_NE(address.value(), entry_.address().value());
523 entry_.Data()->next = address.value();
529 Addr address(entry_.Data()->rankings_node);
530 if (!node_.LazyInit(backend_->File(address), address))
592 STRESS_DCHECK(next_addr.value() != entry_.address().value());
611 if (entry_.address().num_blocks() != num_blocks)
662 // The address is weird so don't attempt to delete it.
773 Addr address(entry->Data()->long_key);
774 DCHECK(address.is_initialized());
776 if (address.is_block_file())
777 offset = address.start_block() * address.BlockSize() + kBlockHeaderSize;
780 File* key_file = const_cast<EntryImpl*>(this)->GetBackingFile(address,
933 backend_->OnEntryDestroyBegin(entry_.address());
1002 Addr address(entry_.Data()->data_addr[index]);
1003 int eof = address.is_initialized() ? entry_size : 0;
1012 address.set_value(entry_.Data()->data_addr[index]);
1013 DCHECK(address.is_initialized());
1014 if (!address.is_initialized()) {
1019 File* file = GetBackingFile(address, index);
1022 LOG(ERROR) << "No file for " << std::hex << address.value();
1027 if (address.is_block_file()) {
1029 file_offset += address.start_block() * address.BlockSize() +
1092 Trace("To PrepareTarget 0x%x", entry_.address().value());
1096 Trace("From PrepareTarget 0x%x", entry_.address().value());
1112 Addr address(entry_.Data()->data_addr[index]);
1115 DCHECK(!address.is_initialized());
1120 File* file = GetBackingFile(address, index);
1125 if (address.is_block_file()) {
1127 file_offset += address.start_block() * address.BlockSize() +
1168 Addr address(entry_.Data()->data_addr[index]);
1169 if (!CreateBlock(size, &address))
1172 entry_.Data()->data_addr[index] = address.value();
1177 bool EntryImpl::CreateBlock(int size, Addr* address) {
1178 DCHECK(!address->is_initialized());
1186 if (!backend_->CreateExternalFile(address))
1191 if (!backend_->CreateBlock(file_type, num_blocks, address))
1201 // important that the entry doesn't keep a reference to this address, or we'll
1202 // end up deleting the contents of |address| once again.
1203 void EntryImpl::DeleteData(Addr address, int index) {
1205 if (!address.is_initialized())
1207 if (address.is_separate_file()) {
1208 int failure = !DeleteCacheFile(backend_->GetFileName(address));
1212 backend_->GetFileName(address).value() << " from the cache.";
1217 backend_->DeleteBlock(address, true);
1238 File* EntryImpl::GetBackingFile(Addr address, int index) {
1243 if (address.is_separate_file())
1244 file = GetExternalFile(address, index);
1246 file = backend_->File(address);
1250 File* EntryImpl::GetExternalFile(Addr address, int index) {
1255 if (file->Init(backend_->GetFileName(address)))
1282 Addr address(entry_.Data()->data_addr[index]);
1283 if (address.is_initialized()) {
1284 if (address.is_block_file() && !MoveToLocalBuffer(index))
1305 Addr address(entry_.Data()->data_addr[index]);
1317 DeleteData(address, index);
1327 if (!address.is_initialized()) {
1353 DCHECK(address.is_initialized());
1362 Addr address(entry_.Data()->data_addr[index]);
1364 DCHECK(address.is_initialized());
1370 File* file = GetBackingFile(address, index);
1373 if (address.is_block_file())
1374 offset = address.start_block() * address.BlockSize() + kBlockHeaderSize;
1388 Addr address(entry_.Data()->data_addr[index]);
1391 DeleteData(address, index);
1413 Addr address(entry_.Data()->data_addr[index]);
1414 if (address.is_initialized() && address.is_separate_file()) {
1443 Addr address(entry_.Data()->data_addr[index]);
1445 DCHECK(!address.is_initialized() || address.is_separate_file());
1449 if (size && !address.is_initialized() && !CreateDataBlock(index, size))
1457 address.set_value(entry_.Data()->data_addr[index]);
1464 if (address.is_block_file()) {
1467 offset = address.start_block() * address.BlockSize() + kBlockHeaderSize;
1470 File* file = GetBackingFile(address, index);
1512 void EntryImpl::GetData(int index, char** buffer, Addr* address) {
1529 address->set_value(entry_.Data()->data_addr[index]);
1530 if (address->is_initialized()) {
1546 entry_.address().value(), node_.address().value());