mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 21:10:30 +00:00
Kernel: Make KString non-copyable and non-movable
The user is supposed to hold these in an OwnPtr but bad things would happen if the user takes these out of the OwnPtr so let's make the class non-copyable and non-movable.
This commit is contained in:
parent
fe0ae3161a
commit
87ff76bd57
Notes:
sideshowbarker
2024-07-18 17:00:53 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/87ff76bd570 Pull-request: https://github.com/SerenityOS/serenity/pull/7691 Reviewed-by: https://github.com/BenWiederhake ✅
1 changed files with 3 additions and 0 deletions
|
@ -12,6 +12,9 @@
|
|||
namespace Kernel {
|
||||
|
||||
class KString {
|
||||
AK_MAKE_NONCOPYABLE(KString);
|
||||
AK_MAKE_NONMOVABLE(KString);
|
||||
|
||||
public:
|
||||
static OwnPtr<KString> try_create_uninitialized(size_t, char*&);
|
||||
static NonnullOwnPtr<KString> must_create_uninitialized(size_t, char*&);
|
||||
|
|
Loading…
Reference in a new issue