From patchwork Wed Feb 18 05:54:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 440804 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 7D6421401DD for ; Wed, 18 Feb 2015 16:54:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=Sc0cBV0pmmX/zt4kSSYO/eqgeNAB3 rh1uIzrQgf6jcJzhDGvKotwSQqVphm7PvYLyQ6VxjD/szNkPXxjmDVDpIAJyDO9Q hK3VpXWOQfg+vORBkN7USxkWrYID2sZKpZRC53yR9qH6gVDh2F1hLM/6+NS4+yAw UNrCpXzASwC7TI= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=24A26bDwLdq4R8fbWCQPQde9JUE=; b=IXz xbwCZStkwf0SIrO2uLTJMEOpzIeqHKdR6L1yDyhJgxOmpi+AoEJ5uOQ105G6AOiM r3GljjkCFLqYHiXWuHn05V1EW9KnDnpOMM3kJTuRGWNVb8kgwdadVrUOh+8N8qX1 qI87AafCXL0xNSRN1PSQauUF70ZuKvKlohOFTfkc= Received: (qmail 28103 invoked by alias); 18 Feb 2015 05:54:27 -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 28091 invoked by uid 89); 18 Feb 2015 05:54:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Wed, 18 Feb 2015 11:24:15 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [COMMITTED] Consolidate arena_lookup and arena_lock into a single arena_get Message-ID: <20150218055415.GA16929@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This seems to have been left behind as an artifact of some old changes and can now be merged. Verified that the only generated code change on x86_64 is that of line numbers in asserts, like so: @@ -27253,7 +27253,7 @@ Disassembly of section .text: 416f09: 48 89 42 20 mov %rax,0x20(%rdx) 416f0d: e9 7e f6 ff ff jmpq 416590 <_int_free+0x230> 416f12: b9 3f 9f 4a 00 mov $0x4a9f3f,%ecx - 416f17: ba d5 0f 00 00 mov $0xfd5,%edx + 416f17: ba d6 0f 00 00 mov $0xfd6,%edx 416f1c: be a8 9b 4a 00 mov $0x4a9ba8,%esi 416f21: bf 6a 9c 4a 00 mov $0x4a9c6a,%edi 416f26: e8 45 e8 ff ff callq 415770 <__malloc_assert> Pushed as obvious. Siddhesh --- ChangeLog | 5 +++++ malloc/malloc.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cdf49aa..3ada4f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-02-18 Siddhesh Poyarekar + + * malloc/malloc.c (__libc_malloc): Consolidate arena_lookup and + arena_lock into a single arena_get. + 2015-02-17 Carlos O'Donell * dl-reloc.c: Inlucde libc-internal.h. diff --git a/malloc/malloc.c b/malloc/malloc.c index ad9487e..f361bad 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2886,9 +2886,8 @@ __libc_malloc (size_t bytes) if (__builtin_expect (hook != NULL, 0)) return (*hook)(bytes, RETURN_ADDRESS (0)); - arena_lookup (ar_ptr); + arena_get (ar_ptr, bytes); - arena_lock (ar_ptr, bytes); if (!ar_ptr) return 0;