ReactOS 0.4.16-dev-340-g0540c21
__malloc_alloc Class Reference

#include <_alloc.h>

Public Types

typedef char value_type
 

Static Public Member Functions

static void *_STLP_CALL allocate (size_t __n)
 
static void _STLP_CALL deallocate (void *__p, size_t)
 
static __oom_handler_type _STLP_CALL set_malloc_handler (__oom_handler_type __f)
 

Detailed Description

Definition at line 63 of file _alloc.h.

Member Typedef Documentation

◆ value_type

Definition at line 66 of file _alloc.h.

Member Function Documentation

◆ allocate()

void *_STLP_CALL __malloc_alloc::allocate ( size_t  __n)
static

Definition at line 131 of file allocators.cpp.

132{
133 void *__result = malloc(__n);
134 if ( 0 == __result ) {
135 __oom_handler_type __my_malloc_handler;
136
137 for (;;) {
138 {
139#ifdef _STLP_THREADS
140 _STLP_auto_lock _l( __oom_handler_lock );
141#endif
142 __my_malloc_handler = __oom_handler;
143 }
144 if ( 0 == __my_malloc_handler) {
146 }
147 (*__my_malloc_handler)();
148 __result = malloc(__n);
149 if ( __result )
150 return __result;
151 }
152 }
153 return __result;
154}
return __n
Definition: _algo.h:75
_STLP_BEGIN_NAMESPACE typedef void(* __oom_handler_type)()
Definition: _alloc.h:60
#define _STLP_THROW_BAD_ALLOC
Definition: _new.h:116
static _STLP_BEGIN_NAMESPACE __oom_handler_type __oom_handler
Definition: allocators.cpp:125
#define malloc
Definition: debug_ros.c:4

◆ deallocate()

static void _STLP_CALL __malloc_alloc::deallocate ( void __p,
size_t   
)
inlinestatic

Definition at line 80 of file _alloc.h.

80{ free((char*)__p); }
#define free
Definition: debug_ros.c:5

◆ set_malloc_handler()

__oom_handler_type _STLP_CALL __malloc_alloc::set_malloc_handler ( __oom_handler_type  __f)
static

Definition at line 156 of file allocators.cpp.

157{
158#ifdef _STLP_THREADS
159 _STLP_auto_lock _l( __oom_handler_lock );
160#endif
162 __oom_handler = __f;
163 return __old;
164}

The documentation for this class was generated from the following files: