-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
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
Labels
No labels