Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
include
tenok
mpool.h
Go to the documentation of this file.
1
4
#ifndef __MPOOL_H__
5
#define __MPOOL_H__
6
7
#include <stddef.h>
8
#include <stdint.h>
9
10
struct
mpool
{
11
int
offset;
12
size_t
size;
13
uint8_t *mem;
14
};
15
22
void
mpool_init
(
struct
mpool
*
mpool
, uint8_t *mem,
size_t
size);
23
29
void
*
mpool_alloc
(
struct
mpool
*
mpool
,
size_t
size);
30
31
#endif
mpool_init
void mpool_init(struct mpool *mpool, uint8_t *mem, size_t size)
Initialize a memory poll object with a contiguous memory space.
Definition:
mpool.c:5
mpool_alloc
void * mpool_alloc(struct mpool *mpool, size_t size)
Allocate a memory space from the memory pool.
mpool
Definition:
mpool.h:10
Generated by
1.9.1