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:
Gunnar Beutner 2021-06-02 12:00:09 +02:00 committed by Andreas Kling
parent fe0ae3161a
commit 87ff76bd57
Notes: sideshowbarker 2024-07-18 17:00:53 +09:00

View file

@ -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*&);