public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] malloc: Deprecate more hook-related functionality
@ 2020-07-13  7:59 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2020-07-13  7:59 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e72b98e6f858583a3ef904e27c6fbd932bdc86c8

commit e72b98e6f858583a3ef904e27c6fbd932bdc86c8
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Jul 13 09:58:37 2020 +0200

    malloc: Deprecate more hook-related functionality
    
    __morecore, __after_morecore_hook, and __default_morecore had not
    been deprecated in commit 7d17596c198f11fa85cbcf9587443f262e63b616
    ("Mark malloc hook variables as deprecated"), probably by accident.
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

Diff:
---
 NEWS            | 7 +++++++
 malloc/malloc.h | 7 ++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 92dcb77fef..f69d48a38f 100644
--- a/NEWS
+++ b/NEWS
@@ -142,6 +142,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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-13  7:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13  7:59 [glibc] malloc: Deprecate more hook-related functionality Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).