
#ifndef PLS_ALIGNMENT_H
#define PLS_ALIGNMENT_H

#include <cstdint>
#include <cstdlib>

#include "system_details.h"

namespace pls {
namespace internal {
namespace base {
namespace alignment {

template<typename T>
struct aligned_wrapper {
  alignas(system_details::CACHE_LINE_SIZE) unsigned char data[sizeof(T)];
  T *pointer() { return reinterpret_cast<T *>(data); }
};
void *allocate_aligned(size_t size);

system_details::pointer_t next_alignment(system_details::pointer_t size);
system_details::pointer_t previous_alignment(system_details::pointer_t size);
char *next_alignment(char *pointer);

}

}
}
}

#endif //PLS_ALIGNMENT_H
