@@ -305,14 +305,14 @@ class ByteStream {
305305 void clear_wrapped_buf () { wrapped_page_.buf_ = nullptr ; }
306306
307307 /* ================ Part 1: basic ================ */
308- FORCE_INLINE uint32_t remaining_size () const {
308+ FORCE_INLINE int64_t remaining_size () const {
309309 ASSERT (total_size_.load () >= read_pos_);
310310 return total_size_.load () - read_pos_;
311311 }
312312 FORCE_INLINE bool has_remaining () const { return remaining_size () > 0 ; }
313313
314314 FORCE_INLINE void mark_read_pos () { marked_read_pos_ = read_pos_; }
315- FORCE_INLINE uint32_t get_mark_len () const {
315+ FORCE_INLINE int64_t get_mark_len () const {
316316 ASSERT (marked_read_pos_ <= read_pos_);
317317 return read_pos_ - marked_read_pos_;
318318 }
@@ -345,8 +345,8 @@ class ByteStream {
345345 this ->total_size_ .store (other.total_size_ .load ());
346346 }
347347
348- FORCE_INLINE uint32_t total_size () const { return total_size_.load (); }
349- FORCE_INLINE uint32_t read_pos () const { return read_pos_; };
348+ FORCE_INLINE int64_t total_size () const { return total_size_.load (); }
349+ FORCE_INLINE int64_t read_pos () const { return read_pos_; };
350350 FORCE_INLINE void wrapped_buf_advance_read_pos (uint32_t size) {
351351 if (size + read_pos_ > total_size_.load ()) {
352352 read_pos_ = total_size_.load ();
@@ -526,7 +526,7 @@ class ByteStream {
526526
527527 // get tail position <tail_, total_size_> atomically
528528 Page *host_end = nullptr ;
529- uint32_t host_total_size = 0 ;
529+ int64_t host_total_size = 0 ;
530530 while (true ) {
531531 host_end = host_.tail_ .load ();
532532 host_total_size = host_.total_size_ .load ();
@@ -642,10 +642,10 @@ class ByteStream {
642642 OptionalAtomic<Page *> head_;
643643 OptionalAtomic<Page *> tail_;
644644 Page *read_page_; // only one thread is allow to reader this ByteStream
645- OptionalAtomic<uint32_t > total_size_; // total size in byte
646- uint32_t read_pos_; // current reader position
647- uint32_t marked_read_pos_; // current reader position
648- uint32_t page_size_;
645+ OptionalAtomic<int64_t > total_size_; // total size in byte
646+ int64_t read_pos_; // current reader position
647+ int64_t marked_read_pos_; // current reader position
648+ int64_t page_size_;
649649 AllocModID mid_;
650650 Page wrapped_page_;
651651};
0 commit comments