Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/jemalloc/dist/src realloc(ptr, 0) != { free(ptr...



details:   https://anonhg.NetBSD.org/src/rev/c114d637729b
branches:  trunk
changeset: 965831:c114d637729b
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 03 16:10:23 2019 +0000

description:
realloc(ptr, 0) != { free(ptr); return NULL; }
    http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_400

diffstat:

 external/bsd/jemalloc/dist/src/jemalloc.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r aa64f6bb9850 -r c114d637729b external/bsd/jemalloc/dist/src/jemalloc.c
--- a/external/bsd/jemalloc/dist/src/jemalloc.c Thu Oct 03 15:36:24 2019 +0000
+++ b/external/bsd/jemalloc/dist/src/jemalloc.c Thu Oct 03 16:10:23 2019 +0000
@@ -2328,6 +2328,8 @@
        LOG("core.realloc.entry", "ptr: %p, size: %zu\n", ptr, size);
 
        if (unlikely(size == 0)) {
+#if 0
+       // http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_400
                if (ptr != NULL) {
                        /* realloc(ptr, 0) is equivalent to free(ptr). */
                        UTRACE(ptr, 0, 0);
@@ -2343,6 +2345,7 @@
                        LOG("core.realloc.exit", "result: %p", NULL);
                        return NULL;
                }
+#endif
                size = 1;
        }
 



Home | Main Index | Thread Index | Old Index