25#include <seastar/util/modules.hh>
31void* allocate_aligned_buffer_impl(
size_t size,
size_t align);
34SEASTAR_MODULE_EXPORT_BEGIN
37 void operator()(
void* p) { ::free(p); }
40template <
typename CharType>
42std::unique_ptr<CharType[], free_deleter> allocate_aligned_buffer(
size_t size,
size_t align) {
43 static_assert(
sizeof(CharType) == 1,
"must allocate byte type");
44 void* ret = internal::allocate_aligned_buffer_impl(size, align);
45 return std::unique_ptr<CharType[], free_deleter>(
reinterpret_cast<CharType *
>(ret));
48SEASTAR_MODULE_EXPORT_END
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Definition: aligned_buffer.hh:36