mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +00:00
Kernel: Add formatter for Kernel::Range
This is very useful when debugging memory allocation in the kernel
This commit is contained in:
parent
f244a25f71
commit
ab196b484a
Notes:
sideshowbarker
2024-07-18 09:19:02 +09:00
Author: https://github.com/ADKaster
Commit: ab196b484a
Pull-request: https://github.com/SerenityOS/serenity/pull/8522
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
1 changed files with 8 additions and 0 deletions
|
@ -58,3 +58,11 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct AK::Formatter<Kernel::Range> : Formatter<FormatString> {
|
||||
void format(FormatBuilder& builder, Kernel::Range value)
|
||||
{
|
||||
return Formatter<FormatString>::format(builder, "{} - {} (size 0x{:08x})", value.base().as_ptr(), value.base().offset(value.size() - 1).as_ptr(), value.size());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue