RTEMS CPU Kit with SuperCore  4.11.2
freechain.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright (c) 2013 Gedare Bloom.
10  *
11  * The license and distribution terms for this file may be
12  * found in the file LICENSE in this distribution or at
13  * http://www.rtems.org/license/LICENSE.
14  */
15 
16 #ifndef _RTEMS_SCORE_FREECHAIN_H
17 #define _RTEMS_SCORE_FREECHAIN_H
18 
19 #include <rtems/score/basedefs.h>
20 #include <rtems/score/chain.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
41 typedef void *( *Freechain_Allocator )( size_t size );
42 
46 typedef struct {
52 
66  Freechain_Control *freechain,
67  Freechain_Allocator allocator,
68  size_t number_nodes,
69  size_t node_size
70 );
71 
85 void *_Freechain_Get(
86  Freechain_Control *freechain,
87  Freechain_Allocator allocator,
88  size_t number_nodes_to_extend,
89  size_t node_size
90 );
91 
99 void _Freechain_Put(
100  Freechain_Control *freechain,
101  void *node
102 );
103 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif
111 /* end of include file */
void _Freechain_Initialize(Freechain_Control *freechain, Freechain_Allocator allocator, size_t number_nodes, size_t node_size)
Initializes a freechain.
Definition: freechain.c:25
This is used to manage a chain.
Definition: chain.h:83
void * _Freechain_Get(Freechain_Control *freechain, Freechain_Allocator allocator, size_t number_nodes_to_extend, size_t node_size)
Gets a node from the freechain.
Definition: freechain.c:49
Chain_Control Free
Chain of free nodes.
Definition: freechain.h:50
void _Freechain_Put(Freechain_Control *freechain, void *node)
Puts a node back onto the freechain.
Definition: freechain.c:75
void *(* Freechain_Allocator)(size_t size)
Allocator function.
Definition: freechain.h:41
Chain Handler API.
Basic Definitions.
The freechain control.
Definition: freechain.h:46