diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-03-15 09:54:59 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-11-22 14:31:25 +0000 |
commit | 3244a1fc1981694d582d7afbdc7e8e283530d485 (patch) | |
tree | bac2f035a8aca267492e965f6245039dcfb553b2 /malloc | |
parent | 0f2a4c9573e3c1f2e593f450cc27e6f4e6a84ddc (diff) | |
download | glibc-3244a1fc1981694d582d7afbdc7e8e283530d485.zip glibc-3244a1fc1981694d582d7afbdc7e8e283530d485.tar.gz glibc-3244a1fc1981694d582d7afbdc7e8e283530d485.tar.bz2 |
cheri: malloc: align up without breaking capability in memalign
Diffstat (limited to 'malloc')
-rw-r--r-- | malloc/malloc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 062ca0d..02df29d 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4982,8 +4982,7 @@ _int_memalign (mstate av, size_t alignment, size_t bytes) we can move to the next aligned spot -- we've allocated enough total room so that this is always possible. */ - brk = (char *) mem2chunk (((unsigned long) (m + alignment - 1)) & - - ((signed long) alignment)); + brk = (char *) mem2chunk (m + alignment - ((unsigned long) (m) % alignment)); if ((unsigned long) (brk - (char *) (p)) < MINSIZE) brk += alignment; |