mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it possible to pass a FlatPtr to something that has u32 and u64 overloads.
This commit is contained in:
@@ -34,13 +34,13 @@ namespace Kernel {
|
||||
struct [[gnu::packed]] MallocPerformanceEvent
|
||||
{
|
||||
size_t size;
|
||||
uintptr_t ptr;
|
||||
FlatPtr ptr;
|
||||
};
|
||||
|
||||
struct [[gnu::packed]] FreePerformanceEvent
|
||||
{
|
||||
size_t size;
|
||||
uintptr_t ptr;
|
||||
FlatPtr ptr;
|
||||
};
|
||||
|
||||
struct [[gnu::packed]] PerformanceEvent
|
||||
@@ -52,14 +52,14 @@ struct [[gnu::packed]] PerformanceEvent
|
||||
MallocPerformanceEvent malloc;
|
||||
FreePerformanceEvent free;
|
||||
} data;
|
||||
uintptr_t stack[32];
|
||||
FlatPtr stack[32];
|
||||
};
|
||||
|
||||
class PerformanceEventBuffer {
|
||||
public:
|
||||
PerformanceEventBuffer();
|
||||
|
||||
KResult append(int type, uintptr_t arg1, uintptr_t arg2);
|
||||
KResult append(int type, FlatPtr arg1, FlatPtr arg2);
|
||||
|
||||
size_t capacity() const { return m_buffer.size() / sizeof(PerformanceEvent); }
|
||||
size_t count() const { return m_count; }
|
||||
|
||||
Reference in New Issue
Block a user