[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r8311 - in /fsf/trunk/libc: ./ malloc/ sysdeps/posix/ sysdeps/unix/sysv/linux/
- To: commits@xxxxxxxxxx
- Subject: [commits] r8311 - in /fsf/trunk/libc: ./ malloc/ sysdeps/posix/ sysdeps/unix/sysv/linux/
- From: eglibc@xxxxxxxxxx
- Date: Sat, 18 Apr 2009 07:05:11 -0000
Author: eglibc
Date: Sat Apr 18 00:05:09 2009
New Revision: 8311
Log:
Import glibc-mainline for 2009-04-18
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/malloc/hooks.c
fsf/trunk/libc/malloc/malloc.c
fsf/trunk/libc/sysdeps/posix/preadv.c
fsf/trunk/libc/sysdeps/posix/readv.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Apr 18 00:05:09 2009
@@ -1,3 +1,16 @@
+2009-04-17 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * malloc/malloc.c (malloc_info): Also output system memory information.
+
+ * sysdeps/unix/sysv/linux/kernel-features.h: All supported
+ architectures have preadv/pwritev in 2.6.30.
+
+ * sysdeps/posix/preadv.c: Reading of zero bytes is no error.
+ * sysdeps/posix/readv.c: Likewise.
+ Reported by Markus Armbruster <armbru@xxxxxxxxxx>.
+
+ * malloc/hooks.c (top_check): Force hook value into register.
+
2009-04-16 Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
* elf/rtld.c (dl_main): Really call _dl_sysdep_start_cleanup after all
Modified: fsf/trunk/libc/malloc/hooks.c
==============================================================================
--- fsf/trunk/libc/malloc/hooks.c (original)
+++ fsf/trunk/libc/malloc/hooks.c Sat Apr 18 00:05:09 2009
@@ -235,7 +235,7 @@
return -1;
}
/* Call the `morecore' hook if necessary. */
- void (*hook) (void) = __after_morecore_hook;
+ void (*hook) (void) = force_reg (__after_morecore_hook);
if (hook)
(*hook) ();
main_arena.system_mem = (new_brk - mp_.sbrk_base) + sbrk_size;
Modified: fsf/trunk/libc/malloc/malloc.c
==============================================================================
--- fsf/trunk/libc/malloc/malloc.c (original)
+++ fsf/trunk/libc/malloc/malloc.c Sat Apr 18 00:05:09 2009
@@ -22,6 +22,10 @@
/*
This is a version (aka ptmalloc2) of malloc/free/realloc written by
Doug Lea and adapted to multiple threads/arenas by Wolfram Gloger.
+
+ There have been substantial changesmade after the integration into
+ glibc in all parts of the code. Do not look for much commonality
+ with the ptmalloc2 version.
* Version ptmalloc2-20011215
based on:
@@ -6245,6 +6249,8 @@
size_t total_nfastblocks = 0;
size_t total_avail = 0;
size_t total_fastavail = 0;
+ size_t total_system = 0;
+ size_t total_max_system = 0;
void mi_arena (mstate ar_ptr)
{
@@ -6350,11 +6356,17 @@
sizes[NFASTBINS].from, sizes[NFASTBINS].to,
sizes[NFASTBINS].total, sizes[NFASTBINS].count);
+ total_system += ar_ptr->system_mem;
+ total_max_system += ar_ptr->max_system_mem;
+
fprintf (fp,
"</sizes>\n<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
"<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
+ "<system type=\"current\" size=\"%zu\"/>\n"
+ "<system type=\"max\" size=\"%zu\"/>\n"
"</heap>\n",
- nfastblocks, fastavail, nblocks, avail);
+ nfastblocks, fastavail, nblocks, avail,
+ ar_ptr->system_mem, ar_ptr->max_system_mem);
}
fputs ("<malloc version=\"1\">\n", fp);
@@ -6371,8 +6383,11 @@
fprintf (fp,
"<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
"<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
+ "<system type=\"current\" size=\"%zu\n/>\n"
+ "<system type=\"max\" size=\"%zu\n/>\n"
"</malloc>\n",
- total_nfastblocks, total_fastavail, total_nblocks, total_avail);
+ total_nfastblocks, total_fastavail, total_nblocks, total_avail,
+ total_system, total_max_system);
return 0;
}
Modified: fsf/trunk/libc/sysdeps/posix/preadv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/preadv.c (original)
+++ fsf/trunk/libc/sysdeps/posix/preadv.c Sat Apr 18 00:05:09 2009
@@ -83,7 +83,7 @@
/* Read the data. */
ssize_t bytes_read = PREAD (fd, buffer, bytes, offset);
- if (bytes_read <= 0)
+ if (bytes_read < 0)
return -1;
/* Copy the data from BUFFER into the memory specified by VECTOR. */
Modified: fsf/trunk/libc/sysdeps/posix/readv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/readv.c (original)
+++ fsf/trunk/libc/sysdeps/posix/readv.c Sat Apr 18 00:05:09 2009
@@ -70,7 +70,7 @@
/* Read the data. */
ssize_t bytes_read = __read (fd, buffer, bytes);
- if (bytes_read <= 0)
+ if (bytes_read < 0)
return -1;
/* Copy the data from BUFFER into the memory specified by VECTOR. */
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h Sat Apr 18 00:05:09 2009
@@ -531,9 +531,7 @@
#endif
/* Support for preadv and pwritev was added in 2.6.30. */
-#if __LINUX_KERNEL_VERSION >= 0x02061e \
- && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
- || defined __ia64__ || defined __sparc__ && defined __sh__)
+#if __LINUX_KERNEL_VERSION >= 0x02061e
# define __ASSUME_PREADV 1
# define __ASSUME_PWRITEV 1
#endif