Skip to content

Commit

Permalink
refactor(port): delete unused Memory_Resource::is_equal
Browse files Browse the repository at this point in the history
  • Loading branch information
strager committed Oct 29, 2023
1 parent d0b8ceb commit 8e9f826
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/quick-lint-js/container/linked-bump-allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ class Linked_Bump_Allocator final : public Memory_Resource {
this->deallocate_bytes(p, bytes);
}

bool do_is_equal(const Memory_Resource& other) const override {
return this == static_cast<const Linked_Bump_Allocator*>(&other);
}

private:
struct alignas(maximum(alignment, alignof(void*))) Chunk_Header {
explicit Chunk_Header(Chunk* previous) : previous(previous) {}
Expand Down
4 changes: 0 additions & 4 deletions src/quick-lint-js/port/memory-resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class New_Delete_Resource_Impl : public Memory_Resource {
::operator delete(p);
#endif
}

bool do_is_equal(const Memory_Resource& other) const override {
return this == static_cast<const New_Delete_Resource_Impl*>(&other);
}
};
}

Expand Down
5 changes: 0 additions & 5 deletions src/quick-lint-js/port/memory-resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@ class Memory_Resource {
return this->do_deallocate(p, bytes, alignment);
}

bool is_equal(const Memory_Resource& other) const {
return this->do_is_equal(other);
}

protected:
virtual void* do_allocate(std::size_t bytes, std::size_t alignment) = 0;
virtual void do_deallocate(void* p, std::size_t bytes,
std::size_t alignment) = 0;
virtual bool do_is_equal(const Memory_Resource& other) const = 0;
};

// Like std::pmr::new_delete_resource.
Expand Down
5 changes: 0 additions & 5 deletions test/quick-lint-js/tracking-memory-resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ class Tracking_Memory_Resource : public Memory_Resource {
}
}

bool do_is_equal(const Memory_Resource&) const override {
QLJS_UNIMPLEMENTED();
return false;
}

Memory_Resource* underlying_memory_ = new_delete_resource();

std::uint64_t allocated_bytes_ = 0;
Expand Down

0 comments on commit 8e9f826

Please sign in to comment.