ReactOS 0.4.16-dev-927-g467dec4
calloc_base.cpp File Reference
#include <corecrt_internal.h>
#include <malloc.h>
#include <new.h>
Include dependency graph for calloc_base.cpp:

Go to the source code of this file.

Functions

 __declspec (noinline) _CRTRESTRICT void *__cdecl _calloc_base(size_t const count
 
 for (;;)
 

Variables

size_t const size
 
size_t const requested_block_size = count * size
 
size_t const actual_block_size
 

Function Documentation

◆ __declspec()

__declspec ( noinline  ) const

◆ for()

for ( ;;  )

Definition at line 33 of file calloc_base.cpp.

34 {
36
37 // If allocation succeeded, return the pointer to the new block:
38 if (block)
39 {
40 return block;
41 }
42
43 // Otherwise, see if we need to call the new handler, and if so call it.
44 // If the new handler fails, just return nullptr:
46 {
47 errno = ENOMEM;
48 return nullptr;
49 }
50
51 // The new handler was successful; try to allocate aagain...
52 }
#define ENOMEM
Definition: acclib.h:84
size_t const actual_block_size
Definition: calloc_base.cpp:29
_Check_return_ _ACRTIMP int __cdecl _callnewh(_In_ size_t _Size)
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
HANDLE __acrt_heap
Definition: heap_handle.cpp:15
#define errno
Definition: errno.h:18
_ACRTIMP int __cdecl _query_new_mode(void)
Definition: heap.c:217
static unsigned int block
Definition: xmlmemory.c:101

Variable Documentation

◆ actual_block_size

size_t const actual_block_size
Initial value:
? 1
size_t const requested_block_size
Definition: calloc_base.cpp:28

Definition at line 29 of file calloc_base.cpp.

Referenced by for().

◆ requested_block_size

size_t const requested_block_size = count * size

Definition at line 28 of file calloc_base.cpp.

◆ size

Initial value:
{
#define _HEAP_MAXREQ
Definition: malloc.h:24
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define _VALIDATE_RETURN_NOEXC(expr, errorcode, retexpr)

Definition at line 21 of file calloc_base.cpp.