From patchwork Tue Sep 5 20:25:17 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: 111740 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp3323180qge; Tue, 5 Sep 2017 13:26:27 -0700 (PDT) X-Received: by 10.99.130.198 with SMTP id w189mr5111166pgd.175.1504643187569; Tue, 05 Sep 2017 13:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504643187; cv=none; d=google.com; s=arc-20160816; b=U8BzKabdVW8H3txt6K4BU2l4OBp697uJuseOJs1HtX+hAZjp7A8YcDk+mRn6/hFL8V 4H5yNmKsybz+c+oOZi8YTByStN8L1Hhe16hRued6CitKerSUa7RXb4/YuTOGsbRF1ZRn nDjXsq1to6EuJ2iUNjkgURE3mwHxSPOmzOo/WN71m3PRKQsr0JwQ0vgvepLVpB1ayQoy 3fGmr3xeum/HJV/kPhV5r5Jcn5v10epGxJvCD87Iks4c2s6QJhlrK99jcAdYkzr04WrL NTfvbiLGWRukHHGuHkdGWwY9TM8/jLTk7trJkdPHp8uzFdpHgNd+j7na5nfSrtgQXdoM WC+Q== 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:cc: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=vNvXvq/YMFrd6O0WBAEOcoW3aw/0OUbKgfdhdeg2PX4=; b=EYdvJP7zUjUn2p46Lvj8MSPMirptoYvCwHFS3RBacFKvKdtEUzygclPzNiCThDmNQS DG8yqc3MDRIWH0C6fS7SoZXYUq+BbUDrpOtsPsQ4TCb4svR26FIG49NuwB8H0AxLLwVl Y79rJp/Wjmkvry1rs0oyvhRbgeSC4vvuqcWWDe5lnDJHmGaH/r973gsrdLkCOg4EWmEJ viIOxc/RodXD//9hiGLr4pOqwwGh9f5usnVjFfBjUvbhU/R5nOrX2G8U1V94sFHU6n6S r5vUR6Ja8yt4280X7TIadEBOwtqcaAj0ebRjtsPwBv4AE8w6MB2CXloQP1rL7qRE0MPk 7IPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=eppzXjrl; spf=pass (google.com: domain of libc-alpha-return-84210-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84210-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 a2si888386pln.695.2017.09.05.13.26.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 13:26:27 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-84210-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=eppzXjrl; spf=pass (google.com: domain of libc-alpha-return-84210-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84210-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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=RFuMb/6HNh/7cgBO1xt+2XCHlWuFeTu ZMe9wxt/si0Xo4wduXlaFUNxeZJWqofc5VSA/3ajVALLMqw8Y7SZKMniS3fZPGGB 0Ia6WD87bq/Huzre7IQPHlewp7Da9bJ+Cnq8xggJVg4+BAM7VWWPDzVbSIHeGLEx 9Dq4NtTGLNlQ= 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:cc:subject:date:message-id:in-reply-to :references; s=default; bh=TU3l6j62j8eYc0Oqx+FPOHXejcM=; b=eppzX jrlJ4aaREo2qEmBq5ExFDYScI/Q+Xk4+/vmEJE+a6gD9pfigkwFEkFS4I4Whtj4k Mymmd89Ue9gmoWMH1/gogvikwRFqjLKPjGQ22gB9lVXcFbbyu1USxD+MgvnjHU1E GmPZs6nVsjrASMXPa7T8/wfEd8sNCftYGuEjAo= Received: (qmail 49302 invoked by alias); 5 Sep 2017 20:25:53 -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 48698 invoked by uid 89); 5 Sep 2017 20:25:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f173.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:cc:subject:date:message-id:in-reply-to :references; bh=vNvXvq/YMFrd6O0WBAEOcoW3aw/0OUbKgfdhdeg2PX4=; b=SzsrPZelGED90Nj5Cau0MJX8MpbP35m+nT5HplIS4eacWZUjBZT5RXWU2mzhMm0LHL sDv8iwIJvBMr7Ch691uc4JTStyVWgOLBzOwUDYZX69lMdiD9tGE/JptIGOYJ033Ei3kJ WSbhPiYk1NtfUawkx2apee3uoWLZevKxF3AZQJmHAA8s8rE3MyZZ8HDU5C+GRvL9Ayp+ 2DVifjfxdJOG9tCIWCN1dbe7UOrfNTBsMeUSvL49i6WyY2CdAu1Z8XPqvLisv81AtYYg l/b4Bmb5rUT9RGO6gQlP6Ew6KWdvPG9DGxtGmcoyyQliy2EyLye644BS3MbjLjHQ+DIz 5QPg== X-Gm-Message-State: AHPjjUgo4chA1VDRbmfKDVptGlHuVQxFi5Jv6dePn2C6fC2ZWGdy3saD DT+3r8r4LWCe0Tgeomt3lA== X-Google-Smtp-Source: ADKCNb59IurxUORVc3t5j4aUlWMDzJ0qCrSqQodAnGDkSC6uuCyz5ljaazhJZrfidgK9d17Pcs/zUg== X-Received: by 10.55.176.1 with SMTP id z1mr483053qke.44.1504643138872; Tue, 05 Sep 2017 13:25:38 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 4/9] Sync scratch_buffer with gnulib Date: Tue, 5 Sep 2017 17:25:17 -0300 Message-Id: <1504643122-14874-5-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1504643122-14874-1-git-send-email-adhemerval.zanella@linaro.org> References: <1504643122-14874-1-git-send-email-adhemerval.zanella@linaro.org> This patch syncs the scratch_buffer grom gnulib commit 3866ef6 with GLIBC code. Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. * include/scratch_buffer.h (scratch_buffer): Use a C99 align method instead of GCC extension. * malloc/scratch_buffer_grow.c [!_LIBC]: Include libc-config.h. * malloc/scratch_buffer_grow_preserve.c [!_LIBC]: Likewise. * malloc/scratch_buffer_set_array_size.c [!_LIBC]: Likewise. --- ChangeLog | 6 ++++++ include/scratch_buffer.h | 3 +-- malloc/scratch_buffer_grow.c | 6 +++++- malloc/scratch_buffer_grow_preserve.c | 6 +++++- malloc/scratch_buffer_set_array_size.c | 6 +++++- 5 files changed, 22 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/include/scratch_buffer.h b/include/scratch_buffer.h index dd17a4a..bb04662 100644 --- a/include/scratch_buffer.h +++ b/include/scratch_buffer.h @@ -66,8 +66,7 @@ struct scratch_buffer { void *data; /* Pointer to the beginning of the scratch area. */ size_t length; /* Allocated space at the data pointer, in bytes. */ - char __space[1024] - __attribute__ ((aligned (__alignof__ (max_align_t)))); + max_align_t __space[(1023 + sizeof (max_align_t)) / sizeof (max_align_t)]; }; /* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space diff --git a/malloc/scratch_buffer_grow.c b/malloc/scratch_buffer_grow.c index 22bae50..d2df028 100644 --- a/malloc/scratch_buffer_grow.c +++ b/malloc/scratch_buffer_grow.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see . */ +#ifndef _LIBC +# include +#endif + #include #include @@ -49,4 +53,4 @@ __libc_scratch_buffer_grow (struct scratch_buffer *buffer) buffer->length = new_length; return true; } -libc_hidden_def (__libc_scratch_buffer_grow); +libc_hidden_def (__libc_scratch_buffer_grow) diff --git a/malloc/scratch_buffer_grow_preserve.c b/malloc/scratch_buffer_grow_preserve.c index 18543ef..9268615 100644 --- a/malloc/scratch_buffer_grow_preserve.c +++ b/malloc/scratch_buffer_grow_preserve.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see . */ +#ifndef _LIBC +# include +#endif + #include #include #include @@ -60,4 +64,4 @@ __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer) buffer->length = new_length; return true; } -libc_hidden_def (__libc_scratch_buffer_grow_preserve); +libc_hidden_def (__libc_scratch_buffer_grow_preserve) diff --git a/malloc/scratch_buffer_set_array_size.c b/malloc/scratch_buffer_set_array_size.c index 8ab6d9d..6fcc115 100644 --- a/malloc/scratch_buffer_set_array_size.c +++ b/malloc/scratch_buffer_set_array_size.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see . */ +#ifndef _LIBC +# include +#endif + #include #include #include @@ -57,4 +61,4 @@ __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer, buffer->length = new_length; return true; } -libc_hidden_def (__libc_scratch_buffer_set_array_size); +libc_hidden_def (__libc_scratch_buffer_set_array_size)