AnDiXL commented on code in PR #3698:
URL: https://github.com/apache/brpc/pull/3698#discussion_r4438894166


##########
test/resource_pool_unittest.cpp:
##########
@@ -456,4 +456,34 @@ TEST_F(ResourcePoolTest, verify_get) {
 
     clear_resources<int>();
 }
+
+struct BAIDU_CACHELINE_ALIGNMENT CachelineObject {
+    int value;
+};
+
+TEST_F(ResourcePoolTest, plain_new_honors_cacheline_alignment) {
+    // Pools, their per-thread LocalPool and brpc's SocketPool are
+    // cacheline-aligned and created with plain `new'. C++14 builds need
+    // -faligned-new for that; glibc malloc then returns 16-byte aligned
+    // storage. tcmalloc, linked into this test, may hide the problem, so
+    // also require the compiler to use aligned new.
+#if !defined(__cpp_aligned_new)
+    FAIL() << "Build with C++17 or -faligned-new";

Review Comment:
   Configuration now stops first on such toolchains, so this test only runs 
where aligned new is expected to be in effect, and it fails if it isn't.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to