@@ -306,14 +306,14 @@ class ByteStream {
306306 void clear_wrapped_buf () { wrapped_page_.buf_ = nullptr ; }
307307
308308 /* ================ Part 1: basic ================ */
309- FORCE_INLINE uint32_t remaining_size () const {
309+ FORCE_INLINE int64_t remaining_size () const {
310310 ASSERT (total_size_.load () >= read_pos_);
311311 return total_size_.load () - read_pos_;
312312 }
313313 FORCE_INLINE bool has_remaining () const { return remaining_size () > 0 ; }
314314
315315 FORCE_INLINE void mark_read_pos () { marked_read_pos_ = read_pos_; }
316- FORCE_INLINE uint32_t get_mark_len () const {
316+ FORCE_INLINE int64_t get_mark_len () const {
317317 ASSERT (marked_read_pos_ <= read_pos_);
318318 return read_pos_ - marked_read_pos_;
319319 }
@@ -346,8 +346,8 @@ class ByteStream {
346346 this ->total_size_ .store (other.total_size_ .load ());
347347 }
348348
349- FORCE_INLINE uint32_t total_size () const { return total_size_.load (); }
350- FORCE_INLINE uint32_t read_pos () const { return read_pos_; };
349+ FORCE_INLINE int64_t total_size () const { return total_size_.load (); }
350+ FORCE_INLINE int64_t read_pos () const { return read_pos_; };
351351 FORCE_INLINE void wrapped_buf_advance_read_pos (uint32_t size) {
352352 if (size + read_pos_ > total_size_.load ()) {
353353 read_pos_ = total_size_.load ();
@@ -527,7 +527,7 @@ class ByteStream {
527527
528528 // get tail position <tail_, total_size_> atomically
529529 Page *host_end = nullptr ;
530- uint32_t host_total_size = 0 ;
530+ int64_t host_total_size = 0 ;
531531 while (true ) {
532532 host_end = host_.tail_ .load ();
533533 host_total_size = host_.total_size_ .load ();
@@ -643,10 +643,10 @@ class ByteStream {
643643 OptionalAtomic<Page *> head_;
644644 OptionalAtomic<Page *> tail_;
645645 Page *read_page_; // only one thread is allow to reader this ByteStream
646- OptionalAtomic<uint32_t > total_size_; // total size in byte
647- uint32_t read_pos_; // current reader position
648- uint32_t marked_read_pos_; // current reader position
649- uint32_t page_size_;
646+ OptionalAtomic<int64_t > total_size_; // total size in byte
647+ int64_t read_pos_; // current reader position
648+ int64_t marked_read_pos_; // current reader position
649+ int64_t page_size_;
650650 AllocModID mid_;
651651 Page wrapped_page_;
652652};
0 commit comments