Skip to content

Verify TriviallyCopyable on all buffer page kinds #822

@connortsui20

Description

@connortsui20

Right now, there is no guardrail against adding a member/field that might not be trivially copyable to a buffer page. For example, students can add shared_ptr or a mutex or even a vector into a buffer page like one of the B+ Tree internal node pages.

Adding a type that makes an allocation (for example a vector) into a buffer page is immediately a memory leak once that buffer page is evicted or dropped. When that page comes back, I guess you just have to hope that the memory is still there and still valid. And in the case of shared_ptr I'm pretty sure that is immediately UB.

We can add a static assert with is_trivially_copyable on to all of the page kinds to make sure this does not happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions