Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed Nov 23, 2023
1 parent d4c8350 commit f607156
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/co/fast.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ class __coapi stream {
_p = cap > 0 ? (char*)co::alloc(cap) : 0;
}

stream(char* p, size_t cap, size_t size)
: _cap(cap), _size(size), _p(p) {
}

~stream() { this->reset(); }

stream(const stream&) = delete;
Expand Down
4 changes: 4 additions & 0 deletions include/co/fastring.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class __coapi fastring : public fast::stream {
memset(_p, c, n);
}

fastring(char* p, size_t cap, size_t size)
: fast::stream(p, cap, size) {
}

fastring(const void* s, size_t n)
: fast::stream(n + !!n, n) {
memcpy(_p, s, n);
Expand Down

0 comments on commit f607156

Please sign in to comment.