17#ifndef NANOSTACK_MEMORY_MANAGER_H
18#define NANOSTACK_MEMORY_MANAGER_H
20#include "EMACMemoryManager.h"
34 emac_mem_buf_t *
alloc_heap(uint32_t size, uint32_t align)
override;
47 emac_mem_buf_t *
alloc_pool(uint32_t size, uint32_t align)
override;
67 void free(emac_mem_buf_t *buf)
override;
88 void copy(emac_mem_buf_t *to_buf,
const emac_mem_buf_t *from_buf)
override;
102 void cat(emac_mem_buf_t *to_buf, emac_mem_buf_t *cat_buf)
override;
112 emac_mem_buf_t *
get_next(
const emac_mem_buf_t *buf)
const override;
120 void *
get_ptr(
const emac_mem_buf_t *buf)
const override;
128 uint32_t
get_len(
const emac_mem_buf_t *buf)
const override;
139 void set_len(emac_mem_buf_t *buf, uint32_t len)
override;
void set_len(emac_mem_buf_t *buf, uint32_t len) override
Sets the payload size of the buffer.
uint32_t get_pool_alloc_unit(uint32_t align) const override
Get memory buffer pool allocation unit.
emac_mem_buf_t * get_next(const emac_mem_buf_t *buf) const override
Returns the next buffer.
void * get_ptr(const emac_mem_buf_t *buf) const override
Return pointer to the payload of the buffer.
void free(emac_mem_buf_t *buf) override
Free memory buffer chain.
emac_mem_buf_t * alloc_heap(uint32_t size, uint32_t align) override
Allocates memory buffer from the heap.
uint32_t get_total_len(const emac_mem_buf_t *buf) const override
Return total length of a memory buffer chain.
uint32_t get_len(const emac_mem_buf_t *buf) const override
Return payload size of the buffer.
emac_mem_buf_t * alloc_pool(uint32_t size, uint32_t align) override
Allocates memory buffer chain from a pool.
void copy(emac_mem_buf_t *to_buf, const emac_mem_buf_t *from_buf) override
Copy a memory buffer chain.
void cat(emac_mem_buf_t *to_buf, emac_mem_buf_t *cat_buf) override
Concatenate two memory buffer chains.