mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 18:57:42 +00:00
Kernel: Add operator delete for KString
This doesn't change anything because our global operator delete also calls kfree() - however instead of relying on this implementation detail this makes this dependency more explicit.
This commit is contained in:
parent
f0e9fd09b4
commit
596361791c
2 changed files with 7 additions and 0 deletions
|
@ -57,4 +57,9 @@ OwnPtr<KString> KString::try_clone() const
|
||||||
return try_create(view());
|
return try_create(view());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KString::operator delete(void* string)
|
||||||
|
{
|
||||||
|
kfree(string);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ public:
|
||||||
static OwnPtr<KString> try_create(StringView const&);
|
static OwnPtr<KString> try_create(StringView const&);
|
||||||
static NonnullOwnPtr<KString> must_create(StringView const&);
|
static NonnullOwnPtr<KString> must_create(StringView const&);
|
||||||
|
|
||||||
|
void operator delete(void*);
|
||||||
|
|
||||||
OwnPtr<KString> try_clone() const;
|
OwnPtr<KString> try_clone() const;
|
||||||
|
|
||||||
bool is_empty() const { return m_length == 0; }
|
bool is_empty() const { return m_length == 0; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue