comparison packages/services/memalloc/common/current/include/kapi.h @ 1687:eb235374a7ae

2004-06-24 Oyvind Harboe <oyvind.harboe@zylin.com> * Added cyg_memalloc_alloc_fail() fn which is invoked before return NULL from failed allocations. Useful breakpoint site. Andrew Lunn wrote some of the code and pointed out various wrinkles to be ironed out.
author asl
date Mon, 05 Jul 2004 11:07:04 +0000
parents 40a7aad7873c
children
comparison
equal deleted inserted replaced
1686:961151dc048e 1687:eb235374a7ae
56 //####DESCRIPTIONEND#### 56 //####DESCRIPTIONEND####
57 // 57 //
58 //========================================================================*/ 58 //========================================================================*/
59 59
60 /* CONFIGURATION */ 60 /* CONFIGURATION */
61 61 #include <pkgconf/system.h>
62 #include <pkgconf/memalloc.h> 62 #include <pkgconf/memalloc.h>
63 63
64 /* TYPE DEFINITIONS */ 64 /* TYPE DEFINITIONS */
65 65 #ifdef CYGPKG_KERNEL
66 #include <cyg/kernel/kapi.h>
67 #else
68 typedef cyg_uint32 cyg_handle_t;
69 #endif
70
71 /*---------------------------------------------------------------------------*/
72
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76
77 /*---------------------------------------------------------------------------*/
66 struct cyg_mempool_var; 78 struct cyg_mempool_var;
67 typedef struct cyg_mempool_var cyg_mempool_var; 79 typedef struct cyg_mempool_var cyg_mempool_var;
68 80
69 struct cyg_mempool_fix; 81 struct cyg_mempool_fix;
70 typedef struct cyg_mempool_fix cyg_mempool_fix; 82 typedef struct cyg_mempool_fix cyg_mempool_fix;
174 186
175 /* Puts information about a variable memory pool into the structure 187 /* Puts information about a variable memory pool into the structure
176 provided. */ 188 provided. */
177 void cyg_mempool_fix_get_info(cyg_handle_t fixpool, cyg_mempool_info *info) __THROW; 189 void cyg_mempool_fix_get_info(cyg_handle_t fixpool, cyg_mempool_info *info) __THROW;
178 190
191 /* user overrideable function invoked before running out of memory. */
192 __externC void cyg_memalloc_alloc_fail(char * file, int line, cyg_int32 size)
193 __THROW;
194
195 /*---------------------------------------------------------------------------*/
196 #ifdef __cplusplus
197 }
198 #endif
199
200 /*---------------------------------------------------------------------------*/
179 201
180 202
181 #endif /* ifndef CYGONCE_MEMALLOC_KAPI_H */ 203 #endif /* ifndef CYGONCE_MEMALLOC_KAPI_H */
182 /* EOF kapi.h */ 204 /* EOF kapi.h */