From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 78600469710 for ; Mon, 8 Jun 2020 17:04:54 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id a9so17076510ljn.6 for ; Mon, 08 Jun 2020 07:04:54 -0700 (PDT) Date: Mon, 8 Jun 2020 17:04:50 +0300 From: Cyrill Gorcunov Message-ID: <20200608140450.GJ134822@grain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH 09/10] port: make port_c_entry not PACKED List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On Thu, May 21, 2020 at 10:37:32PM +0200, Vladislav Shpilevoy wrote: > PACKED structures don't have padding between their members and > after the structure (needed to be able to store them in an array). > > Port_c_entry was PACKED, since it does not have padding between > its members anyway, and the padding in the end was not needed, > because these objects are never stored in an array. As a result, > sizeof(port_c_entry) was not aligned too. > > Appeared, that mempool, used to allocate port_c_entry objects, > can't work correctly, when object size is not aligned at least by > 8 bytes. Because mempool does not do any alignment internally, and > uses the free objects as a temporary storage for some metadata, > requiring 8 byte alignment. > > The patch removes PACKED attribute from port_c_entry, so now its > size is aligned by 8 bytes, and mempool works fine. > > Part of #4609 Reviewed-by: Cyrill Gorcunov