<HTML><BODY><div id="composeWebView_editable_content" data-mailruapp-compose-id="composeWebView_editable_content" style="text-align: left;"><div>LGTM.</div><div><br></div><div>I wonder how big is impact of all alignment activities? Can you consult with Mons to obtain a reference test?</div><div><br></div><div id="mail-app-auto-signature">

Best regards,<div>Sergos </div>
</div><br><br>Saturday, 20 June 2020, 21:01 +0300 from Vladislav Shpilevoy  <v.shpilevoy@tarantool.org>:<br><div id="composeWebView_previouse_content" data-mailruapp-compose-id="composeWebView_previouse_content"><blockquote id="mail-app-auto-quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(11, 102, 249); margin: 10px 0px 10px 5px; padding: 0px 0px 0px 10px; display: inherit;" data-darkosha-id="1:3"><div class="js-helper js-readmsg-msg" data-darkosha-id="1:4" style="">
        <style type="text/css" data-darkosha-id="1:5" style=""></style>
        <div data-darkosha-id="1:6" style="">
                <base target="_self" href="https://e.mail.ru/" data-darkosha-id="1:7" style="">
                
            <div id="style_15926760950954611378_BODY" data-darkosha-id="1:8" style="">Mempool expects aligned object size. Because it uses the free<br data-darkosha-id="1:9" style="">
blocks to store metadata in them, in a struct mslab. Which needs<br data-darkosha-id="1:10" style="">
alignment.<br data-darkosha-id="1:11" style="">
<br data-darkosha-id="1:12" style="">
Part of <a href="https://github.com/tarantool/tarantool/issues/5063" target="_blank" data-darkosha-id="1:13" style="">https://github.com/tarantool/tarantool/issues/5063</a><br data-darkosha-id="1:14" style="">
---<br data-darkosha-id="1:15" style="">
Branch: <a href="http://github.com/tarantool/small/tree/gerold103/tarantool/gh-5063-not-aligned-test" target="_blank" data-darkosha-id="1:16" style="">http://github.com/tarantool/small/tree/gerold103/tarantool/gh-5063-not-aligned-test</a><br data-darkosha-id="1:17" style="">
Issue: <a href="https://github.com/tarantool/tarantool/issues/5063" target="_blank" data-darkosha-id="1:18" style="">https://github.com/tarantool/tarantool/issues/5063</a><br data-darkosha-id="1:19" style="">
<br data-darkosha-id="1:20" style="">
 test/mempool.c | 7 +++++++<br data-darkosha-id="1:21" style="">
 1 file changed, 7 insertions(+)<br data-darkosha-id="1:22" style="">
<br data-darkosha-id="1:23" style="">
diff --git a/test/mempool.c b/test/mempool.c<br data-darkosha-id="1:24" style="">
index 298ba17..65eabaf 100644<br data-darkosha-id="1:25" style="">
--- a/test/mempool.c<br data-darkosha-id="1:26" style="">
+++ b/test/mempool.c<br data-darkosha-id="1:27" style="">
@@ -1,3 +1,4 @@<br data-darkosha-id="1:28" style="">
+#include "trivia/util.h"<br data-darkosha-id="1:29" style="">
 #include <small/mempool.h><br data-darkosha-id="1:30" style="">
 #include <small/quota.h><br data-darkosha-id="1:31" style="">
 #include <stdio.h><br data-darkosha-id="1:32" style="">
@@ -121,6 +122,12 @@ int main()<br data-darkosha-id="1:33" style="">
   objsize = rand() % OBJSIZE_MAX;<br data-darkosha-id="1:34" style="">
   if (objsize < OBJSIZE_MIN)<br data-darkosha-id="1:35" style="">
           objsize = OBJSIZE_MIN;<br data-darkosha-id="1:36" style="">
+       /*<br data-darkosha-id="1:37" style="">
+        * Mempool does not work with not aligned sizes. Because<br data-darkosha-id="1:38" style="">
+        * it utilizes the unused blocks for storing internal<br data-darkosha-id="1:39" style="">
+        * info, which needs alignment.<br data-darkosha-id="1:40" style="">
+        */<br data-darkosha-id="1:41" style="">
+       objsize = small_align(objsize, alignof(uint64_t));<br data-darkosha-id="1:42" style="">
 <br data-darkosha-id="1:43" style="">
   quota_init(&quota, UINT_MAX);<br data-darkosha-id="1:44" style="">
 <br data-darkosha-id="1:45" style="">
-- <br data-darkosha-id="1:46" style="">
2.21.1 (Apple Git-122.3)<br data-darkosha-id="1:47" style="">
<br data-darkosha-id="1:48" style="">
</div>
            
        
                <base target="_self" href="https://e.mail.ru/" data-darkosha-id="1:49" style="">
        </div>

        
</div></blockquote></div></div></BODY></HTML>