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/847fcf7c7252
branches:  trunk
changeset: 845465:847fcf7c7252
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 204fd005363b -r 847fcf7c7252 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