Skip to content

Commit

Permalink
Add alignment comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbs96 committed Oct 21, 2024
1 parent cc286df commit 02cd1a7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/phasar/DataFlow/IfdsIde/Solver/GenericSolverResults.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ template <typename N, typename D, typename L> class GenericSolverResults final {
static_assert(std::is_trivially_copyable_v<type>,
"SolverResults should only be a *view* into the results of "
"an IFDS/IDE solver.");
static_assert(alignof(type) <= alignof(void *));
static_assert(sizeof(type) <= sizeof(Buffer));

/// NOTE: We reinterpret the bytes of the `Buffer` as `type`, so it better
/// be properly aligned
static_assert(
alignof(type) <= alignof(void *),
"The solver-results type is improperly aligned for the inline buffer");
static_assert(
sizeof(type) <= sizeof(Buffer),
"The inline buffer is to small to hold this type of solver-result");

static_assert(std::is_trivially_copyable_v<GenericSolverResults>);

Expand Down

0 comments on commit 02cd1a7

Please sign in to comment.