-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37111 from trackreco/from-CMSSW_12_3_X_2022-02-28…
…-1100_mkFit_X [MkFit] round up size arguments to aligned_alloc upwards to align value.
- Loading branch information
Showing
5 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef RecoTracker_MkFitCore_src_Matriplex_Memory_h | ||
#define RecoTracker_MkFitCore_src_Matriplex_Memory_h | ||
|
||
#include <cstdlib> | ||
|
||
namespace Matriplex { | ||
|
||
constexpr std::size_t round_up_align64(std::size_t size) { | ||
constexpr std::size_t mask = 64 - 1; | ||
return size & mask ? (size & ~mask) + 64 : size; | ||
} | ||
|
||
inline void* aligned_alloc64(std::size_t size) { return std::aligned_alloc(64, round_up_align64(size)); } | ||
|
||
} // namespace Matriplex | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters