From patchwork Fri Jul 10 12:56:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 40012 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02CD93840C26; Fri, 10 Jul 2020 12:56:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02CD93840C26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594385773; bh=x2EbmTdZ+Piz1NkuyfjBUuAWHZ9lKtn5Wb8L97lsmao=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MLTHK2bHLNCi12vrDtKT7jUlldRKAR7fHZEaSr9mp4cJ5ivIm6dbudaxJyhwf2yae WtXXqWLZ8OoFnVzae8GDpxnG757RQE2DM1Jn7lnKif0xmh6RDLbpwhn+nOppMcE77+ l9gZeeNmK9jgEWv+uj43hcqz85lwHMQmtscwMnyY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 0E4E33857013 for ; Fri, 10 Jul 2020 12:56:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0E4E33857013 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-P-mI4_VwNK2EOk4aOOIVfA-1; Fri, 10 Jul 2020 08:56:07 -0400 X-MC-Unique: P-mI4_VwNK2EOk4aOOIVfA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DEA331080 for ; Fri, 10 Jul 2020 12:56:06 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-113-118.ams2.redhat.com [10.36.113.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6309D1A265 for ; Fri, 10 Jul 2020 12:56:06 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] malloc: Deprecate more hook-related functionality Date: Fri, 10 Jul 2020 14:56:04 +0200 Message-ID: <87pn9334wr.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" __morecore, __after_morecore_hook and __after_morecore_hook had not been deprecated in commit 7d17596c198f11fa85cbcf9587443f262e63b616 ("Mark malloc hook variables as deprecated"), probably by accident. Tested on i686-linux-gnu. Reviewed-by: Carlos O'Donell --- NEWS | 7 +++++++ malloc/malloc.h | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 0b25b4fde9..8fb1dac36d 100644 --- a/NEWS +++ b/NEWS @@ -131,6 +131,13 @@ Deprecated and removed features, and other changes affecting compatibility: storing RPC keys only supported the obsolete and insecure AUTH_DES flavor of secure RPC.) +* The __morecore and __after_morecore_hook malloc hooks and the default + implementation __default_morecore have been deprecated. Applications + should use malloc interposition to change malloc behavior, and mmap to + allocate anonymous memory. A future version of glibc may require that + applications which use the malloc hooks must preload a special shared + object, to enable the hooks. + Changes to build and runtime requirements: * powerpc64le requires GCC 7.4 or newer. This is required for supporting diff --git a/malloc/malloc.h b/malloc/malloc.h index a6903fdd54..e0e91a9331 100644 --- a/malloc/malloc.h +++ b/malloc/malloc.h @@ -75,11 +75,11 @@ extern void *pvalloc (size_t __size) __THROW __attribute_malloc__ __wur; /* Underlying allocation function; successive calls should return contiguous pieces of memory. */ -extern void *(*__morecore) (ptrdiff_t __size); +extern void *(*__morecore) (ptrdiff_t __size) __MALLOC_DEPRECATED; /* Default value of `__morecore'. */ extern void *__default_morecore (ptrdiff_t __size) -__THROW __attribute_malloc__; +__THROW __attribute_malloc__ __MALLOC_DEPRECATED; /* SVID2/XPG mallinfo structure */ @@ -156,7 +156,8 @@ extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment, size_t __size, const void *) __MALLOC_DEPRECATED; -extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); +extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void) + __MALLOC_DEPRECATED; __END_DECLS