19#include "BuddyMemoryManager.h"
33 _start_block->size =
memSize -
sizeof(Block);
34 _start_block->is_free =
true;
35 _start_block->self = _start_block;
37 _size = _start_block->size;
42 addToBlocks(_start_block,
p);
55 while (l < 32 && !_free_blocks[l])
61 tmp = _free_blocks[
l];
62 removeFromBlocks(
tmp, l);
64 while ((
tmp->size +
sizeof(Block)) / 2 >=
size +
sizeof(Block))
86 addToBlocks(
tmp, lowerLog2(
tmp->size +
sizeof(Block)));
89 if (
tmp->size == _size)
95 tensor.set_data_buffer(
nullptr);
void allocate_memory(luci_interpreter::Tensor &tensor) final
void release_memory(luci_interpreter::Tensor &tensor) final
BuddyMemoryManager(uint8_t *memory_start, int32_t memSize)
const T * data(const std::vector< T, Alloc > &v)
size_t getDataTypeSize(DataType data_type)
T must_cast(loco::Node *node)
uint32_t num_elements(const Shape &shape)
The number of elements of a feature map of a given shape.