From patchwork Mon Sep 18 14:42:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 112925 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3747289qgf; Mon, 18 Sep 2017 07:43:18 -0700 (PDT) X-Received: by 10.84.229.143 with SMTP id c15mr37190495plk.311.1505745798382; Mon, 18 Sep 2017 07:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505745798; cv=none; d=google.com; s=arc-20160816; b=lUFiW/A0jU1PWwHQjW/ESl5qi6O5iKoPzmxl4CevENq8lvvFn5c5CEgqoKejEqIgZ0 nGQjlaMhaPhUXY4E5w6AR3GoousFRtsrcXEpy2LH222Z5W8303re074imLvOCzNVNo1p H5kJYZ+pXJzVAdrTWdI+4bR1k39OwHgd6VFH5kPn3xcKPfQVzskITAe6+N6e3Yynq3JC /Pyzo/MxeA+ezqd9tfmr617SYl/b8Yc2/GsCsgUxaOGCCBDyLChnSaRBce0+E1JSyy5g ynPX9j9wGua8NUTcsAqySFLv1ssKd9QxaGhHDki7zqm4mxeyjr54xcIDloKQhzOvThFl HawQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=xX5XtwVwSQxL89L5UfdtATIw2jrxOLknUzTWLh+A7G4=; b=h1tjqlY3e4JQ2BooZbftrNRQK93WTYEcnf6sUAPNJyvKLEA+t/aB+045lp+UiMWuCA /1gWrqlRwYu3R9hE1wfB6peOFQ0hJ60RVf6+ZqbXD/QduSdVYRBcjYfTgQIvifvxAT5D W/2jGnJL02zYnSx3LlIttcXRqmV+8ZPBB7i4HSacUQF+Fg6oDuWT3D6tW/ElA+Q2l2Sb HLMPL9TjlQBjkYn3vooh2AJ8Jp4GWH8yhj8hn/tZMWJkn+BEJXcKdQCk97SbTZgnsPLt 0+LMFKVS4UJP8jOWbyf41DUQ4DWrDq81CiPiOTh124thOhWeunpfReqRVbHKDDjnvCbS nBTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=MV0soZ1o; spf=pass (google.com: domain of libc-alpha-return-84684-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84684-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l26si161603pgc.788.2017.09.18.07.43.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Sep 2017 07:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-84684-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=MV0soZ1o; spf=pass (google.com: domain of libc-alpha-return-84684-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84684-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=A/AAzqJRHTyHzXHgd+51NvzPew9V/p5 FZX3b0cPutXi41b1SPMALGgTFZRpTmLpqpjZxsXZF1wsaTjnOXR8Yw2lw8AtqMsg 8Q/+2EP3cldPGVYrMHFif4nO13sFV/zFkBWrY6vvEeOi1VkYJv5f+9HRVq8a+yur YqMOwUSuDZEc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=Prjfkpia1wQmP9ZRlfmCBjWkVzM=; b=MV0so Z1olojfFcP6b6l2yPgzpopeWK65JsyacubS09cIgACeSPlWPc5sPjpGM9U4q59JR rXquMq7vkgyR6i0l6oqUhp7Fx8A2cZvjaO+igrLYUQxib69KQD/gB5qYGPLmCz6T KwGfKgKf/LHH6SsLLvL+kkmuV4dAIF8wy/QPS4= Received: (qmail 26646 invoked by alias); 18 Sep 2017 14:43:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 25309 invoked by uid 89); 18 Sep 2017 14:43:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=xX5XtwVwSQxL89L5UfdtATIw2jrxOLknUzTWLh+A7G4=; b=iRy4P0WFSjwP2ivBABJSrSd52OZUEgvw1u/YPhQiD+7m0S4O6bK5FQ2WuRl/Gasbrm Zwafbg1J6LusA64Axy/2X/AL3xho8XNEwqqKAcx7MiO39rkyy7Y7PXP9fGZ6Cc5DKYdj +mLgF2CXAa+kOGBbl6pKdJa4HaViYFtDbDkzh/bx6a2ZigcFgeTJp1rLTAz10R56gET7 lliH2ANht2i7cGM31A7FhhjT+vmNbb9gq/ZGbMaH1YwlhsnSAXvVR9jmGwMp5LrJ9TGr EKjRBQ8flxXMReGFPCri2cr/rk8GucwERiQsd6r5hV+NjyM9lnBHDMFGJLrHdFpILGkO jAzg== X-Gm-Message-State: AHPjjUiDxQaJ5/1XmtBYi3/mNqP/PZRO6bEUWHowggN5IgLux3ofgG1h QwGEAEYBp+KiaZjvJrhLEQ== X-Google-Smtp-Source: AOwi7QDhUepFLnPyxdF9BYQeSBrM/tgcF8pj448Lg3D6t1InwuAPhwhtpEgYQjfof0WbZnaYXLkVXg== X-Received: by 10.200.4.16 with SMTP id v16mr53093882qtg.265.1505745783621; Mon, 18 Sep 2017 07:43:03 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/2] Use C11 _Alignas on scratch_buffer internal buffer Date: Mon, 18 Sep 2017 11:42:54 -0300 Message-Id: <1505745774-29303-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1505745774-29303-1-git-send-email-adhemerval.zanella@linaro.org> References: <1505745774-29303-1-git-send-email-adhemerval.zanella@linaro.org> Checked on x86_64-linux-gnu. * include/scratch_buffer.h (scratch_buffer): Use C11 _Alignas on __space field definition if compiler supports it. --- ChangeLog | 3 +++ include/scratch_buffer.h | 5 +++++ 2 files changed, 8 insertions(+) -- 2.7.4 diff --git a/include/scratch_buffer.h b/include/scratch_buffer.h index bb04662..2e0c8b5 100644 --- a/include/scratch_buffer.h +++ b/include/scratch_buffer.h @@ -60,13 +60,18 @@ #include #include #include +#include /* Scratch buffer. Must be initialized with scratch_buffer_init before its use. */ struct scratch_buffer { void *data; /* Pointer to the beginning of the scratch area. */ size_t length; /* Allocated space at the data pointer, in bytes. */ +#if __alignas_is_defined + _Alignas (max_align_t) char __space[1024]; +#else max_align_t __space[(1023 + sizeof (max_align_t)) / sizeof (max_align_t)]; +#endif }; /* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space