28 #define LOCK_HEAP _mlock( _HEAP_LOCK ) 29 #define UNLOCK_HEAP _munlock( _HEAP_LOCK ) 32 #define SAVED_PTR(x) ((void *)((DWORD_PTR)((char *)x - sizeof(void *)) & \ 33 ~(sizeof(void *) - 1))) 34 #define ALIGN_PTR(ptr, alignment, offset) ((void *) \ 35 ((((DWORD_PTR)((char *)ptr + alignment + sizeof(void *) + offset)) & \ 36 ~(alignment - 1)) - offset)) 62 TRACE(
"(%ld) returning %p\n",
size, retval);
68 freed = (*MSVCRT_new_handler)(
size);
157 (*MSVCRT_new_handler)(
size);
245 memset( &heap, 0,
sizeof(heap) );
280 if (
size == ~(
size_t)0)
282 WARN(
":Probably called with non wine-allocated memory, ret = -1\n");
360 TRACE(
"(%p)\n", memblock);
374 void *memblock, *
temp, **saved;
378 if ((alignment & (alignment - 1)) != 0)
392 if (alignment <
sizeof(
void *))
393 alignment =
sizeof(
void *);
425 size_t alignment,
size_t offset)
427 void *
temp, **saved;
428 size_t old_padding, new_padding, old_size;
435 if ((alignment & (alignment - 1)) != 0)
455 if (alignment <
sizeof(
void *))
456 alignment =
sizeof(
void *);
466 old_padding = (
char *)memblock - (
char *)*saved;
469 old_size =
_msize(*saved);
477 if (old_size < old_padding)
482 old_size -= old_padding;
496 new_padding = (
char *)memblock - (
char *)
temp;
528 if (new_padding != old_padding)
529 memmove((
char *)memblock, (
char *)
temp + old_padding, (old_size <
size) ? old_size :
size);
541 TRACE(
"(%p, %lu, %lu)\n", memblock,
size, alignment);
void CDECL free(void *ptr)
#define memmove(s1, s2, n)
#define ERROR_NO_MORE_ITEMS
#define PROCESS_HEAP_UNCOMMITTED_RANGE
GLuint GLuint GLsizei count
int CDECL _heapadd(void *mem, size_t size)
void *CDECL realloc(void *ptr, size_t size)
static unsigned int MSVCRT_amblksiz
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
void *CDECL MSVCRT_operator_new(size_t size)
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
void *CDECL _aligned_offset_malloc(size_t size, size_t alignment, size_t offset)
static size_t numberOfElements
void *CDECL malloc(size_t size)
#define ALIGN_PTR(ptr, alignment, offset)
#define PROCESS_HEAP_REGION
void *CDECL MSVCRT_operator_new_dbg(size_t size, int type, const char *file, int line)
#define MSVCRT_INVALID_PMT(x)
void *CDECL _expand(void *mem, size_t size)
static int MSVCRT_new_mode
#define PROCESS_HEAP_ENTRY_BUSY
BOOL WINAPI HeapWalk(HANDLE hHeap, LPPROCESS_HEAP_ENTRY lpEntry)
void *CDECL _aligned_offset_realloc(void *memblock, size_t size, size_t alignment, size_t offset)
MSVCRT_new_handler_func CDECL MSVCRT__query_new_handler(void)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int(CDECL * MSVCRT_new_handler_func)(size_t size)
int CDECL MSVCRT__set_new_mode(int mode)
void *CDECL _aligned_malloc(size_t size, size_t alignment)
void *CDECL _aligned_realloc(void *memblock, size_t size, size_t alignment)
int CDECL _callnewh(size_t size)
_CRTIMP int *__cdecl _errno(void)
void CDECL _aligned_free(void *memblock)
unsigned int *CDECL __p__amblksiz(void)
#define MSVCRT_CHECK_PMT(x)
int CDECL memmove_s(void *dest, size_t numberOfElements, const void *src, size_t count)
SIZE_T WINAPI HeapCompact(HANDLE hHeap, DWORD dwFlags)
static MSVCRT_new_handler_func MSVCRT_new_handler
void _dosmaperr(unsigned long oserrcode)
intptr_t CDECL _get_heap_handle(void)
int CDECL strncpy_s(char *dest, size_t numberOfElements, const char *src, size_t count)
size_t CDECL _get_sbh_threshold(void)
int CDECL _heapwalk(_HEAPINFO *next)
static unsigned __int64 next
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int CDECL _set_sbh_threshold(size_t threshold)
int CDECL MSVCRT__query_new_mode(void)
MSVCRT_new_handler_func CDECL MSVCRT_set_new_handler(void *func)
size_t CDECL _msize(void *mem)
void *CDECL calloc(size_t count, size_t size)
#define ERROR_CALL_NOT_IMPLEMENTED
static size_t MSVCRT_sbh_threshold
GLuint GLuint GLsizei GLenum type
MSVCRT_new_handler_func CDECL MSVCRT__set_new_handler(MSVCRT_new_handler_func func)
#define HEAP_REALLOC_IN_PLACE_ONLY
#define HeapFree(x, y, z)
int CDECL _heapset(unsigned int value)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
void CDECL MSVCRT_operator_delete(void *mem)