mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibSQL: Make TupleDescriptor a shared pointer instead of a stack object
Tuple descriptors are basically the same for for example all rows in a table. Makes sense to share them instead of copying them for every single row.
This commit is contained in:
parent
9e225d2d05
commit
a5e28f2897
Notes:
sideshowbarker
2024-07-18 05:26:25 +09:00
Author: https://github.com/JanDeVisser
Commit: a5e28f2897
Pull-request: https://github.com/SerenityOS/serenity/pull/8906
Reviewed-by: https://github.com/trflynn89 ✅
17 changed files with 95 additions and 94 deletions
|
@ -14,16 +14,17 @@ namespace SQL {
|
|||
|
||||
class Key : public Tuple {
|
||||
public:
|
||||
Key() = default;
|
||||
explicit Key(TupleDescriptor const&);
|
||||
explicit Key(RefPtr<IndexDef>);
|
||||
Key(TupleDescriptor const&, ByteBuffer&, size_t& offset);
|
||||
Key();
|
||||
explicit Key(NonnullRefPtr<TupleDescriptor> const&);
|
||||
explicit Key(NonnullRefPtr<IndexDef>);
|
||||
Key(NonnullRefPtr<TupleDescriptor> const&, ByteBuffer&, size_t& offset);
|
||||
Key(RefPtr<IndexDef>, ByteBuffer&, size_t& offset);
|
||||
Key(Key const&) = default;
|
||||
RefPtr<IndexDef> index() const { return m_index; }
|
||||
[[nodiscard]] virtual size_t data_length() const override { return Tuple::data_length() + sizeof(u32); }
|
||||
|
||||
private:
|
||||
RefPtr<IndexDef> m_index;
|
||||
RefPtr<IndexDef> m_index { nullptr };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue