From patchwork Sat Nov 7 08:08:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 541226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 60F22140D16 for ; Sat, 7 Nov 2015 19:08:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ialYotXU; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type :in-reply-to; q=dns; s=default; b=Swxhx6iQHtf/PCzWJm4+UvZ9vxii5V JPERAT0bFTgZPNU/MDRystVvgdlScb6w9zDTZHog0v7PiSiuKk9c+OAyRVipDVUq mwNJfhZ31reNLG6yCkKqb40vGHpjLhHWM/siUDiTgQz7n/PAoHP16M7eBU4loirX VIqGBrjxozVsc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type :in-reply-to; s=default; bh=xfF/dqzl+pL303574VHtWAM05z8=; b=ialY otXUr04we/2TzRQocseyKcpuxVGVqudg+IMjnRBKm8Rn3izENPOdMf00iH1OWFAV DbIOgIeO5IQa1ggBkmmgBKJ7nHhPI4BcBbYbJPlFGQbIJsOHt+fGSGBkxqai5q59 2Yty5XuOFUbH2WxKIoi0LpgTBXz7F4tlSVLDyLc= Received: (qmail 5640 invoked by alias); 7 Nov 2015 08:08:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 5629 invoked by uid 89); 7 Nov 2015 08:08:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f50.google.com Received: from mail-pa0-f50.google.com (HELO mail-pa0-f50.google.com) (209.85.220.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 07 Nov 2015 08:08:06 +0000 Received: by pacdm15 with SMTP id dm15so121739167pac.3 for ; Sat, 07 Nov 2015 00:08:05 -0800 (PST) X-Received: by 10.66.158.97 with SMTP id wt1mr24144149pab.155.1446883685150; Sat, 07 Nov 2015 00:08:05 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-160-163-67.gqzg1.fli.bigpond.net.au. [58.160.163.67]) by smtp.gmail.com with ESMTPSA id db8sm4157108pad.43.2015.11.07.00.08.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Nov 2015 00:08:04 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 3D586EA1530; Sat, 7 Nov 2015 18:38:01 +1030 (ACDT) Date: Sat, 7 Nov 2015 18:38:01 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/7] Correct libvtv obstack use Message-ID: <20151107080801.GC17177@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20151107080609.GA17177@bubble.grove.modra.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Fixes a compile error with both old and new obstacks due to obstack_chunk_free having the wrong signature. Also, setting chunk size and alignment before obstack_init is pointless since they are overwritten. * vtv_malloc.cc (obstack_chunk_free): Correct param type. (__vtv_malloc_init): Use obstack_specify_allocation. diff --git a/libvtv/vtv_malloc.cc b/libvtv/vtv_malloc.cc index ecd07eb..ea26b82 100644 --- a/libvtv/vtv_malloc.cc +++ b/libvtv/vtv_malloc.cc @@ -194,7 +194,7 @@ obstack_chunk_alloc (size_t size) } static void -obstack_chunk_free (size_t) +obstack_chunk_free (void *) { /* Do nothing. For our purposes there should be very little de-allocation. */ @@ -217,14 +217,13 @@ __vtv_malloc_init (void) #endif VTV_error (); - obstack_chunk_size (&vtv_obstack) = VTV_PAGE_SIZE; - obstack_alignment_mask (&vtv_obstack) = sizeof (long) - 1; /* We guarantee that the obstack alloc failed handler will never be called because in case the allocation of the chunk fails, it will never return */ obstack_alloc_failed_handler = NULL; - obstack_init (&vtv_obstack); + obstack_specify_allocation (&vtv_obstack, VTV_PAGE_SIZE, sizeof (long), + obstack_chunk_alloc, obstack_chunk_free); malloc_initialized = 1; }