projects
/
kazan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
048f901
)
fix wrong mask in alignment calculation
author
Jacob Lifshay
<programmerjake@gmail.com>
Wed, 20 Sep 2017 05:03:23 +0000
(22:03 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Wed, 20 Sep 2017 05:03:23 +0000
(22:03 -0700)
src/util/memory.h
patch
|
blob
|
history
diff --git
a/src/util/memory.h
b/src/util/memory.h
index 45127e22de00cb432e0b06970e3b4e89ff14fc24..67479cb7765a71bc0fa383721e50a6b5e8fd399b 100644
(file)
--- a/
src/util/memory.h
+++ b/
src/util/memory.h
@@
-66,7
+66,7
@@
struct Aligned_memory_allocator_base<Alignment, true>
Base_pointer base = new unsigned char[size];
auto alignment_start = reinterpret_cast<std::uintptr_t>(base + sizeof(Base_pointer));
auto retval =
- reinterpret_cast<unsigned char *>((alignment_start + Alignment - 1) & (Alignment - 1));
+ reinterpret_cast<unsigned char *>((alignment_start + Alignment - 1) &
~
(Alignment - 1));
auto base_location = reinterpret_cast<Base_pointer *>(retval) - 1;
*base_location = base;
return retval;