Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/io/async_io/async_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AsyncIO : public BasicIO<AsyncIO> {
/**
* @brief Destructor that closes file descriptors and optionally removes the file.
*/
~AsyncIO() override;
~AsyncIO();

public:
/**
Expand Down
2 changes: 1 addition & 1 deletion src/io/buffer_io/buffer_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class BufferIO : public BasicIO<BufferIO> {
*
* If exist_file_ is false (file was newly created), the file is removed.
*/
~BufferIO() override {
~BufferIO() {
close(this->fd_);
// remove file
if (not this->exist_file_) {
Expand Down
18 changes: 13 additions & 5 deletions src/io/common/basic_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ class BasicIO {
*/
explicit BasicIO<IOTmpl>(Allocator* allocator) : allocator_(allocator){};

/**
* @brief Virtual destructor to ensure proper cleanup in derived classes.
*/
virtual ~BasicIO() = default;

/**
* @brief Writes data to the IO object at a specified offset.
*
Expand Down Expand Up @@ -262,6 +257,19 @@ class BasicIO {
uint64_t start_{0};

protected:
/**
* @brief Protected non-virtual destructor.
*
* BasicIO uses CRTP for static polymorphism, so dynamic dispatch is never needed.
* The destructor is non-virtual to avoid introducing a vptr.
*
* The destructor is protected (not public) to prevent deletion through a raw
* BasicIO pointer at compile time. Note that std::shared_ptr<BasicIO<IOTmpl>>
* (used in some datacells) remains safe because the deleter is bound to the
* concrete IOTmpl type at construction time (e.g. via std::make_shared<IOTmpl>).
*/
~BasicIO() = default;
Comment thread
LHT129 marked this conversation as resolved.
Comment thread
LHT129 marked this conversation as resolved.

/**
* @brief Checks if the given offset is valid.
*
Expand Down
2 changes: 1 addition & 1 deletion src/io/memory_block_io/memory_block_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MemoryBlockIO : public BasicIO<MemoryBlockIO> {
/**
* @brief Destructor that deallocates all memory blocks.
*/
~MemoryBlockIO() override;
~MemoryBlockIO();

/**
* @brief Writes data to the blocks at a specified offset.
Expand Down
2 changes: 1 addition & 1 deletion src/io/memory_io/memory_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MemoryIO : public BasicIO<MemoryIO> {
/**
* @brief Destructor that deallocates the memory buffer.
*/
~MemoryIO() override {
~MemoryIO() {
this->allocator_->Deallocate(buffer_);
}

Expand Down
2 changes: 1 addition & 1 deletion src/io/mmap_io/mmap_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MMapIO : public BasicIO<MMapIO> {
/**
* @brief Destructor that unmaps memory and closes file; optionally removes file.
*/
~MMapIO() override;
~MMapIO();

/**
* @brief Writes data to the mapped memory at a specified offset.
Expand Down
2 changes: 1 addition & 1 deletion src/io/noncontinuous_io/noncontinuous_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NonContinuousIO : public BasicIO<NonContinuousIO<IOTmpl>> {
/**
* @brief Default destructor.
*/
~NonContinuousIO() override = default;
~NonContinuousIO() = default;

/**
* @brief Writes data to non-continuous regions at a specified logical offset.
Expand Down
2 changes: 1 addition & 1 deletion src/io/reader_io/reader_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ReaderIO : public BasicIO<ReaderIO> {
/**
* @brief Default destructor.
*/
~ReaderIO() override = default;
~ReaderIO() = default;

/**
* @brief Writes data to the IO object (no-op for read-only IO).
Expand Down
Loading