aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorswarmer <swarmer@yandex-team.com>2024-08-16 00:54:10 +0300
committerswarmer <swarmer@yandex-team.com>2024-08-16 01:04:35 +0300
commitc9c4ee3f77b019e9f14664f722d3bd240da6ddf9 (patch)
treee14641680a9a903ef1f6a04aad380f7d605d050e
parent83e432e997f044d72805caf673f53e3483b21362 (diff)
downloadydb-c9c4ee3f77b019e9f14664f722d3bd240da6ddf9.tar.gz
check the lifetime bounds of stream adapters
f4e1f5605822d2c05fd582aeb7104301b7ca73c7
-rw-r--r--util/stream/aligned.h4
-rw-r--r--util/stream/direct_io.h4
-rw-r--r--util/stream/length.h6
-rw-r--r--util/stream/mem.h2
-rw-r--r--util/stream/multi.h2
-rw-r--r--util/stream/tee.h2
6 files changed, 10 insertions, 10 deletions
diff --git a/util/stream/aligned.h b/util/stream/aligned.h
index 70e7be05a9..3630453838 100644
--- a/util/stream/aligned.h
+++ b/util/stream/aligned.h
@@ -17,7 +17,7 @@
*/
class TAlignedInput: public IInputStream {
public:
- TAlignedInput(IInputStream* s)
+ TAlignedInput(IInputStream* s Y_LIFETIME_BOUND)
: Stream_(s)
, Position_(0)
{
@@ -58,7 +58,7 @@ private:
*/
class TAlignedOutput: public IOutputStream {
public:
- TAlignedOutput(IOutputStream* s)
+ TAlignedOutput(IOutputStream* s Y_LIFETIME_BOUND)
: Stream_(s)
, Position_(0)
{
diff --git a/util/stream/direct_io.h b/util/stream/direct_io.h
index 2e1f2e07dd..66793c67ed 100644
--- a/util/stream/direct_io.h
+++ b/util/stream/direct_io.h
@@ -6,7 +6,7 @@
class TRandomAccessFileInput: public IInputStream {
public:
- TRandomAccessFileInput(TDirectIOBufferedFile& file, ui64 position);
+ TRandomAccessFileInput(TDirectIOBufferedFile& file Y_LIFETIME_BOUND, ui64 position);
protected:
size_t DoRead(void* buf, size_t len) override;
@@ -19,7 +19,7 @@ private:
class TRandomAccessFileOutput: public IOutputStream {
public:
- TRandomAccessFileOutput(TDirectIOBufferedFile& file);
+ TRandomAccessFileOutput(TDirectIOBufferedFile& file Y_LIFETIME_BOUND);
TRandomAccessFileOutput(TRandomAccessFileOutput&&) noexcept = default;
TRandomAccessFileOutput& operator=(TRandomAccessFileOutput&&) noexcept = default;
diff --git a/util/stream/length.h b/util/stream/length.h
index 4d508ae24d..670659e2c8 100644
--- a/util/stream/length.h
+++ b/util/stream/length.h
@@ -14,7 +14,7 @@
*/
class TLengthLimitedInput: public IInputStream {
public:
- inline TLengthLimitedInput(IInputStream* slave, ui64 length) noexcept
+ inline TLengthLimitedInput(IInputStream* slave Y_LIFETIME_BOUND, ui64 length) noexcept
: Slave_(slave)
, Length_(length)
{
@@ -40,7 +40,7 @@ private:
*/
class TCountingInput: public IInputStream {
public:
- inline TCountingInput(IInputStream* slave) noexcept
+ inline TCountingInput(IInputStream* slave Y_LIFETIME_BOUND) noexcept
: Slave_(slave)
, Count_()
{
@@ -72,7 +72,7 @@ private:
*/
class TCountingOutput: public IOutputStream {
public:
- inline TCountingOutput(IOutputStream* slave) noexcept
+ inline TCountingOutput(IOutputStream* slave Y_LIFETIME_BOUND) noexcept
: Slave_(slave)
, Count_()
{
diff --git a/util/stream/mem.h b/util/stream/mem.h
index 53383740a9..cdc6474cc7 100644
--- a/util/stream/mem.h
+++ b/util/stream/mem.h
@@ -27,7 +27,7 @@ public:
*/
TMemoryInput(const void* buf Y_LIFETIME_BOUND, size_t len) noexcept;
TMemoryInput(TString&&) = delete;
- explicit TMemoryInput(const TStringBuf buf) noexcept;
+ explicit TMemoryInput(const TStringBuf buf Y_LIFETIME_BOUND) noexcept;
explicit TMemoryInput(const char* zstr Y_LIFETIME_BOUND)
: TMemoryInput(TStringBuf(zstr))
{
diff --git a/util/stream/multi.h b/util/stream/multi.h
index 8bfd462d99..ef04ec239c 100644
--- a/util/stream/multi.h
+++ b/util/stream/multi.h
@@ -12,7 +12,7 @@
*/
class TMultiInput: public IInputStream {
public:
- TMultiInput(IInputStream* f, IInputStream* s) noexcept;
+ TMultiInput(IInputStream* f Y_LIFETIME_BOUND, IInputStream* s Y_LIFETIME_BOUND) noexcept;
~TMultiInput() override;
private:
diff --git a/util/stream/tee.h b/util/stream/tee.h
index c69e232fb9..8445ffd9c4 100644
--- a/util/stream/tee.h
+++ b/util/stream/tee.h
@@ -12,7 +12,7 @@
*/
class TTeeOutput: public IOutputStream {
public:
- TTeeOutput(IOutputStream* l, IOutputStream* r) noexcept;
+ TTeeOutput(IOutputStream* l Y_LIFETIME_BOUND, IOutputStream* r Y_LIFETIME_BOUND) noexcept;
~TTeeOutput() override;
private: