1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
* @ingroup file68_lib
* @file sc68/alloc68.h
* @author Benjamin Gerard
* @date 2003-04-11
* @brief Dynamic memory management header.
*
*/
/* Copyright (C) 1998-2011 Benjamin Gerard */
/** @defgroup file68_alloc Dynamic memory management
* @ingroup file68_lib
*
* Provides dynamic memory management functions. All dynamically
* allocated buffer in the file68 library should use this set of
* function. Anyway it is possible that some third party library
* do not use them. The default allocator should be standard
* malloc() and free() function unless it has been specified
* at compile time.
*
* @warning the alloc/free handlers work together. It should be change
* only when no allocated buffers remains unless the new
* functions use the same real memory manager.
*
* @warning Use these functions with care in multi-thread context.
* Basically the function should be set once before the
* application goes multi-thread.
*
* @{
*/
/** Allocate dynamic memory.
*
* The alloc68() function calls user defined dynamic memory
* allocation handler.
*
* @param n Size of buffer to allocate.
*
* @return pointer to allocated memory buffer.
* @retval 0 error
*
* @see alloc68_set()
* @see calloc68()
* @see free68()
*/
/** Allocate and clean dynamic memory.
*
* The calloc68() function calls user defined dynamic memory
* allocation handler and fills memory buffer with 0.
*
* @param n Size of buffer to allocate.
*
* @return pointer to allocated memory buffer.
* @retval 0 error
*
* @see alloc68_set()
* @see alloc68()
* @see free68()
*/
/** Free dynamic memory.
*
* The free68() function calls user defined dynamic memory
* free handler.
*
* @param context Context instance (0:default)
* @param data Previously allocated memory buffer.
*
* @return pointer to allocated memory
* @retval 0 Failure.
*
* @see free68_set()
* @see alloc68()
* @see calloc68()
*/
/**
* @}
*/
/* #define _FILE68_ALLOC68_H_ */