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 Revert "jemalloc: Enforce ali...



details:   https://anonhg.NetBSD.org/src/rev/1442fc23932a
branches:  trunk
changeset: 377276:1442fc23932a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 05 10:57:33 2023 +0000

description:
Revert "jemalloc: Enforce alignment-must-divide-size rule of aligned_alloc."

Apparently this restriction was lifted in C17, and this was even
documented in a part of the man page I didn't notice because I got
stuck at the incomplete sentence `The aligned_alloc function conforms
to.'.  Sorry for the noise, folks.

diffstat:

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

diffs (41 lines):

diff -r 19fc3ddd6638 -r 1442fc23932a external/bsd/jemalloc/dist/src/jemalloc.c
--- a/external/bsd/jemalloc/dist/src/jemalloc.c Wed Jul 05 08:39:24 2023 +0000
+++ b/external/bsd/jemalloc/dist/src/jemalloc.c Wed Jul 05 10:57:33 2023 +0000
@@ -1635,9 +1635,6 @@ struct static_opts_s {
        /* Whether to set errno when we encounter an error condition. */
        bool set_errno_on_error;
 
-       /* Whether the alignment must divide the size. */
-       bool alignment_must_divide_size;
-
        /*
         * The minimum valid alignment for functions requesting aligned storage.
         */
@@ -1665,7 +1662,6 @@ static_opts_init(static_opts_t *static_o
        static_opts->assert_nonempty_alloc = false;
        static_opts->null_out_result_on_error = false;
        static_opts->set_errno_on_error = false;
-       static_opts->alignment_must_divide_size = false;
        static_opts->min_alignment = 0;
        static_opts->oom_string = "";
        static_opts->invalid_alignment_string = "";
@@ -1861,11 +1857,6 @@ imalloc_body(static_opts_t *sopts, dynam
            || (dopts->alignment & (dopts->alignment - 1)) != 0)) {
                goto label_invalid_alignment;
        }
-       if (sopts->alignment_must_divide_size) {
-               if (unlikely(dopts->item_size % dopts->alignment)) {
-                       goto label_invalid_alignment;
-               }
-       }
 
        /* This is the beginning of the "core" algorithm. */
 
@@ -2134,7 +2125,6 @@ je_aligned_alloc(size_t alignment, size_
        sopts.bump_empty_alloc = true;
        sopts.null_out_result_on_error = true;
        sopts.set_errno_on_error = true;
-       sopts.alignment_must_divide_size = true;
        sopts.min_alignment = 1;
        sopts.oom_string =
            "<jemalloc>: Error allocating aligned memory: out of memory\n";



Home | Main Index | Thread Index | Old Index