wwbmmm merged PR #2942:
URL: https://github.com/apache/brpc/pull/2942
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
F
yanglimingcn commented on PR #2942:
URL: https://github.com/apache/brpc/pull/2942#issuecomment-2818058214
@wwbmmm 再看一下吧
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To u
yanglimingcn commented on PR #2942:
URL: https://github.com/apache/brpc/pull/2942#issuecomment-2817477709
> 释放的内存会放到tls链表?
现在这个实现,释放内存不会放到tls链表。我是担心影响现在的tls链表。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
chenBright commented on PR #2942:
URL: https://github.com/apache/brpc/pull/2942#issuecomment-2817473558
释放的内存会放到tls链表?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To un
yanglimingcn commented on PR #2942:
URL: https://github.com/apache/brpc/pull/2942#issuecomment-2809027677
重构了这个方案,定义了一个IOReserveAlignedBuf结构,这样对IOBuf的影响是最小的,有需求的用户可以使用,IOReserveAlignedBuf内部使用了不同大小的对齐的内存,所以没有放到tls链表里面。目前只实现了一个reserve方法。
后续有更多需求可以持续迭代。
--
This is an automated message fro
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2034951126
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032659341
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2031323015
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032265002
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2037183270
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1412,35 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2036747959
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1412,35 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2036420248
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1412,35 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2036405794
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2036400628
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2036199633
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035475775
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035475775
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035444772
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035442979
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035329301
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035252881
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035019834
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035019834
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035019834
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2035008046
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2034994950
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2034951126
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2034908574
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2034389319
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
chenBright commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2033438721
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032674185
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
wwbmmm commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032318110
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size_t a
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2033117234
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032674185
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032674185
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032674185
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,50 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
wwbmmm commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2032253068
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size_t a
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2031323015
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2031323015
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
yanglimingcn commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2031323015
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, si
wwbmmm commented on code in PR #2942:
URL: https://github.com/apache/brpc/pull/2942#discussion_r2031245690
##
src/butil/iobuf.cpp:
##
@@ -1371,6 +1371,41 @@ IOBuf::Area IOBuf::reserve(size_t count) {
return result;
}
+IOBuf::Area IOBuf::reserve_aligned(size_t n, size_t a
yanglimingcn opened a new pull request, #2942:
URL: https://github.com/apache/brpc/pull/2942
### What problem does this PR solve?
IOBuf通过reserve_aligned(size_t n, size_t
alignment)函数在IOBuf内部预分配一些符合对齐规则的内存,后续可以通过unsafe_assign函数或者IOBufAsZeroCopyInputStream等函数把这些内存段解析出来,让用户填充数据。
这样做的好
42 matches
Mail list logo