public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Add prototype to _malloc_lock() and *unlock() to malloc.h, and inlude this from nano-mallocr.c
@ 2018-02-16 12:45 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2018-02-16 12:45 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=337cee51cac0d0fa0d68a437d5d182fc84de1241
commit 337cee51cac0d0fa0d68a437d5d182fc84de1241
Author: Jaap de Wolff <info@jasoon.nl>
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 <stdio.h>
#include <string.h>
#include <errno.h>
+#include <malloc.h>
#if DEBUG
#include <assert.h>
@@ -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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-02-16 12:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-16 12:45 [newlib-cygwin] Add prototype to _malloc_lock() and *unlock() to malloc.h, and inlude this from nano-mallocr.c Corinna Vinschen
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).