This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix memory allocator for dynamic address space
ClosedPublic

Authored by etienneb on Aug 4 2016, 10:24 AM.

Details

Summary

The sanitizer allocators can works with a dynamic address space
(i.e. specified with ~0ULL).

Unfortunately, the code was broken on GetMetadata and GetChunkIdx.

The current patch is moving the Win64 memory test to a dynamic
address space. There is a migration to move every concept to a
dynamic address space on windows.

To have a better coverage, the unittest are now testing
dynamic address space on other platforms too.

Diff Detail

Event Timeline

etienneb updated this revision to Diff 66826.Aug 4 2016, 10:24 AM
etienneb retitled this revision from to [compiler-rt] Fix memory allocator for dynamic address space.
etienneb updated this object.
etienneb added a reviewer: rnk.
etienneb added subscribers: chrisha, llvm-commits.
rnk added a reviewer: kcc.Aug 4 2016, 10:28 AM
rnk edited edge metadata.

Kostya, can you review the allocator64 stuff or assign it to someone?

kcc added inline comments.Aug 4 2016, 10:42 AM
lib/sanitizer_common/sanitizer_allocator_primary64.h
122

Implement a separate function GetRegBeg or something

123

hide this logic inside GetChunkIdx

lib/sanitizer_common/tests/sanitizer_allocator_test.cc
33–36

Please explain why in the comment.

etienneb updated this revision to Diff 66829.Aug 4 2016, 11:00 AM
etienneb marked 3 inline comments as done.
etienneb edited edge metadata.

address kcc comments

kcc accepted this revision.Aug 4 2016, 11:09 AM
kcc edited edge metadata.

LGTM with two nits.
Thanks!

lib/sanitizer_common/sanitizer_allocator_primary64.h
99

this code tends to use reinterpret_cast

lib/sanitizer_common/sanitizer_win.cc
224

do you need two lines here (what will clang-format say?)

This revision is now accepted and ready to land.Aug 4 2016, 11:09 AM
etienneb updated this revision to Diff 66831.Aug 4 2016, 11:14 AM
etienneb marked 2 inline comments as done.
etienneb edited edge metadata.

fix nits

etienneb closed this revision.Aug 4 2016, 11:23 AM