From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31182 invoked by alias); 16 Feb 2018 12:45:51 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 31142 invoked by uid 9078); 16 Feb 2018 12:45:51 -0000 Date: Fri, 16 Feb 2018 12:45:00 -0000 Message-ID: <20180216124551.31140.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Add prototype to _malloc_lock() and *unlock() to malloc.h, and inlude this from nano-mallocr.c X-Act-Checkin: newlib-cygwin X-Git-Author: Jaap de Wolff X-Git-Refname: refs/heads/master X-Git-Oldrev: fdc5f5280880b1a31386a713512f092bee5a9a57 X-Git-Newrev: 337cee51cac0d0fa0d68a437d5d182fc84de1241 X-SW-Source: 2018-q1/txt/msg00035.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=337cee51cac0d0fa0d68a437d5d182fc84de1241 commit 337cee51cac0d0fa0d68a437d5d182fc84de1241 Author: Jaap de Wolff Date: Mon Feb 12 12:23:42 2018 +0100 Add prototype to _malloc_lock() and *unlock() to malloc.h, and inlude this from nano-mallocr.c Diff: --- newlib/libc/include/malloc.h | 4 ++++ newlib/libc/stdlib/nano-mallocr.c | 16 +--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/newlib/libc/include/malloc.h b/newlib/libc/include/malloc.h index e12a132..a9dc5bc 100644 --- a/newlib/libc/include/malloc.h +++ b/newlib/libc/include/malloc.h @@ -133,6 +133,10 @@ extern int malloc_trim (size_t); extern int _malloc_trim_r (struct _reent *, size_t); #endif +extern void __malloc_lock(struct _reent *); + +extern void __malloc_unlock(struct _reent *); + /* A compatibility routine for an earlier version of the allocator. */ extern void mstats (char *); diff --git a/newlib/libc/stdlib/nano-mallocr.c b/newlib/libc/stdlib/nano-mallocr.c index a0accdd..13b72c9 100644 --- a/newlib/libc/stdlib/nano-mallocr.c +++ b/newlib/libc/stdlib/nano-mallocr.c @@ -35,6 +35,7 @@ #include #include #include +#include #if DEBUG #include @@ -150,20 +151,6 @@ typedef struct malloc_chunk struct malloc_chunk * next; }chunk; -/* Copied from malloc.h */ -struct mallinfo -{ - size_t arena; /* total space allocated from system */ - size_t ordblks; /* number of non-inuse chunks */ - size_t smblks; /* unused -- always zero */ - size_t hblks; /* number of mmapped regions */ - size_t hblkhd; /* total space in mmapped regions */ - size_t usmblks; /* unused -- always zero */ - size_t fsmblks; /* unused -- always zero */ - size_t uordblks; /* total allocated space */ - size_t fordblks; /* total non-inuse space */ - size_t keepcost; /* top-most, releasable (via malloc_trim) space */ -}; #define CHUNK_OFFSET ((malloc_size_t)(&(((struct malloc_chunk *)0)->next))) @@ -181,7 +168,6 @@ extern void * nano_malloc(RARG malloc_size_t); extern void nano_free (RARG void * free_p); extern void nano_cfree(RARG void * ptr); extern void * nano_calloc(RARG malloc_size_t n, malloc_size_t elem); -extern struct mallinfo nano_mallinfo(RONEARG); extern void nano_malloc_stats(RONEARG); extern malloc_size_t nano_malloc_usable_size(RARG void * ptr); extern void * nano_realloc(RARG void * ptr, malloc_size_t size);