allocator alignment
parent
a71adc328e
commit
8e3fc713e4
|
@ -17,19 +17,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BLT_ALLOCATOR_H
|
#ifndef BLT_ALLOCATOR_H
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <blt/std/utility.h>
|
#include <blt/std/utility.h>
|
||||||
#include <blt/std/types.h>
|
#include <blt/std/types.h>
|
||||||
#include <blt/compatibility.h>
|
#include <blt/compatibility.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace blt
|
namespace blt
|
||||||
|
@ -580,7 +582,7 @@ namespace blt
|
||||||
T* allocate_back()
|
T* allocate_back()
|
||||||
{
|
{
|
||||||
size_t remaining_bytes = BLOCK_SIZE - static_cast<size_t>(head->metadata.offset - head->buffer);
|
size_t remaining_bytes = BLOCK_SIZE - static_cast<size_t>(head->metadata.offset - head->buffer);
|
||||||
|
|
||||||
// auto& back = blocks.back();
|
// auto& back = blocks.back();
|
||||||
// size_t remaining_bytes = size_ - static_cast<size_t>(back.offset - back.buffer);
|
// size_t remaining_bytes = size_ - static_cast<size_t>(back.offset - back.buffer);
|
||||||
// auto pointer = static_cast<void*>(back.offset);
|
// auto pointer = static_cast<void*>(back.offset);
|
||||||
|
|
Loading…
Reference in New Issue