1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

Kernel: Use fallible KBuffer API in PerformanceEventBuffer

This commit is contained in:
Andreas Kling 2020-12-18 20:43:39 +01:00
parent fb9a71bd6a
commit d893498e57
Notes: sideshowbarker 2024-07-19 00:44:56 +09:00
2 changed files with 9 additions and 4 deletions

View file

@ -61,7 +61,12 @@ public:
KResult append(int type, FlatPtr arg1, FlatPtr arg2);
size_t capacity() const { return m_buffer.size() / sizeof(PerformanceEvent); }
size_t capacity() const
{
if (!m_buffer)
return 0;
return m_buffer->size() / sizeof(PerformanceEvent);
}
size_t count() const { return m_count; }
const PerformanceEvent& at(size_t index) const
{
@ -74,7 +79,7 @@ private:
PerformanceEvent& at(size_t index);
size_t m_count { 0 };
KBuffer m_buffer;
OwnPtr<KBuffer> m_buffer;
};
}