Moving mmap to poly, cleaning up devices.

This commit is contained in:
Ben Vanik
2014-08-17 12:57:02 -07:00
parent 24fe169f36
commit 854bcdb60a
37 changed files with 568 additions and 653 deletions

View File

@@ -117,17 +117,12 @@ void STFSEntry::Dump(int indent) {
}
}
STFS::STFS(xe_mmap_ref mmap) {
mmap_ = xe_mmap_retain(mmap);
}
STFS::STFS(poly::MappedMemory* mmap) : mmap_(mmap) {}
STFS::~STFS() {
xe_mmap_release(mmap_);
}
STFS::~STFS() {}
STFS::Error STFS::Load() {
uint8_t* map_ptr = (uint8_t*)xe_mmap_get_addr(mmap_);
size_t map_size = xe_mmap_get_length(mmap_);
uint8_t* map_ptr = mmap_->data();
auto result = ReadHeaderAndVerify(map_ptr);
if (result != kSuccess) {