27#define MSVCRT_size_t size_t
28#define MSVCRT_intptr_t intptr_t
29#define MSVCRT_wchar_t wchar_t
30#define MSVCRT__HEAPBADNODE _HEAPBADNODE
31#define MSVCRT__HEAPOK _HEAPOK
32#define MSVCRT__HEAPEND _HEAPEND
33#define MSVCRT__FREEENTRY _FREEENTRY
34#define MSVCRT__USEDENTRY _USEDENTRY
35#define MSVCRT__HEAPBADBEGIN _HEAPBADBEGIN
36#define MSVCRT_EINVAL EINVAL
37#define MSVCRT_ENOSYS ENOSYS
38#define MSVCRT_ENOMEM ENOMEM
39#define MSVCRT_ERANGE ERANGE
40#define MSVCRT__TRUNCATE _TRUNCATE
41#define MSVCRT__heapinfo _heapinfo
42#define MSVCRT__errno _errno
43#define MSVCRT_calloc calloc
44#define MSVCRT_malloc malloc
45#define MSVCRT_realloc realloc
46#define MSVCRT_free free
47#define MSVCRT_memcpy_s memcpy_s
48#define MSVCRT_memmove_s memmove_s
49#define MSVCRT_strncpy_s strncpy_s
50#define msvcrt_set_errno _dosmaperr
53#define LOCK_HEAP _mlock( _HEAP_LOCK )
54#define UNLOCK_HEAP _munlock( _HEAP_LOCK )
57#define SAVED_PTR(x) ((void *)((DWORD_PTR)((char *)x - sizeof(void *)) & \
58 ~(sizeof(void *) - 1)))
59#define ALIGN_PTR(ptr, alignment, offset) ((void *) \
60 ((((DWORD_PTR)((char *)ptr + alignment + sizeof(void *) + offset)) & \
61 ~(alignment - 1)) - offset))
63#define SB_HEAP_ALIGN 16
81 void *memblock, *
temp, **saved;
100 void *memblock, *
temp, **saved;
104 old_padding = (
char*)
ptr - (
char*)*saved;
108 old_size -= old_padding;
115 new_padding = (
char*)memblock - (
char*)
temp;
117 if(new_padding != old_padding)
163 TRACE(
"(%ld) returning %p\n",
size, retval);
170 freed = (*handler)(
size);
178 throw_exception(EXCEPTION_BAD_ALLOC, 0,
"bad allocation");
264 ret = (*handler)(
size) ? 1 : 0;
313 FIXME(
"small blocks heap not supported\n");
394 WARN(
":Probably called with non wine-allocated memory, ret = -1\n");
410 if(alignment <
sizeof(
void*))
411 alignment =
sizeof(
void*);
414 return _msize(*alloc_ptr)-alignment-
sizeof(
void*);
575 TRACE(
"(%p)\n", memblock);
589 void *memblock, *
temp, **saved;
593 if ((alignment & (alignment - 1)) != 0)
607 if (alignment <
sizeof(
void *))
608 alignment =
sizeof(
void *);
642 void *
temp, **saved;
650 if ((alignment & (alignment - 1)) != 0)
670 if (alignment <
sizeof(
void *))
671 alignment =
sizeof(
void *);
681 old_padding = (
char *)memblock - (
char *)*saved;
684 old_size =
_msize(*saved);
692 if (old_size < old_padding)
697 old_size -= old_padding;
711 new_padding = (
char *)memblock - (
char *)
temp;
743 if (new_padding != old_padding)
744 memmove((
char *)memblock, (
char *)
temp + old_padding, (old_size <
size) ? old_size :
size);
756 TRACE(
"(%p, %lu, %lu)\n", memblock,
size, alignment);
#define DECLSPEC_HOTPATCH
static unsigned char bytes[4]
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_NO_MORE_ITEMS
#define HeapFree(x, y, z)
UINT(* handler)(MSIPACKAGE *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
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
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
SIZE_T WINAPI HeapCompact(HANDLE hHeap, DWORD dwFlags)
BOOL WINAPI HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
BOOL WINAPI HeapDestroy(HANDLE hHeap)
BOOL WINAPI HeapWalk(HANDLE hHeap, LPPROCESS_HEAP_ENTRY lpEntry)
_CRTIMP int __cdecl _set_sbh_threshold(_In_ size_t _NewValue)
_Check_return_ _CRTIMP size_t __cdecl _get_sbh_threshold(void)
#define memmove(s1, s2, n)
#define MSVCRT_INVALID_PMT(x)
#define MSVCRT_CHECK_PMT(x)
unsigned short MSVCRT_wchar_t
unsigned int MSVCRT_size_t
static size_t numberOfElements
#define HEAP_REALLOC_IN_PLACE_ONLY
static unsigned __int64 next
#define MSVCRT_CHECK_PMT_ERR(x, err)
MSVCRT_new_handler_func CDECL MSVCRT__query_new_handler(void)
void *CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size, MSVCRT_size_t alignment, MSVCRT_size_t offset)
void *CDECL _aligned_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment)
void *CDECL _aligned_offset_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment, MSVCRT_size_t offset)
static MSVCRT_size_t MSVCRT_sbh_threshold
#define MSVCRT__USEDENTRY
#define MSVCRT__FREEENTRY
void *CDECL _expand(void *mem, MSVCRT_size_t size)
MSVCRT_new_handler_func CDECL MSVCRT__set_new_handler(MSVCRT_new_handler_func func)
void *CDECL DECLSPEC_HOTPATCH MSVCRT_operator_new(MSVCRT_size_t size)
BOOL msvcrt_init_heap(void)
static int MSVCRT_new_mode
static MSVCRT_size_t msvcrt_heap_size(void *ptr)
int(CDECL * MSVCRT_new_handler_func)(MSVCRT_size_t size)
static void * msvcrt_heap_alloc(DWORD flags, MSVCRT_size_t size)
int CDECL _heapset(unsigned int value)
MSVCRT_intptr_t CDECL _get_heap_handle(void)
void *CDECL MSVCRT_operator_new_dbg(MSVCRT_size_t size, int type, const char *file, int line)
void msvcrt_destroy_heap(void)
MSVCRT_new_handler_func CDECL MSVCRT_set_new_handler(void *func)
int CDECL _callnewh(MSVCRT_size_t size)
#define MSVCRT__HEAPBADNODE
void *CDECL _aligned_realloc(void *memblock, MSVCRT_size_t size, MSVCRT_size_t alignment)
static void * msvcrt_heap_realloc(DWORD flags, void *ptr, MSVCRT_size_t size)
unsigned int *CDECL __p__amblksiz(void)
void CDECL DECLSPEC_HOTPATCH MSVCRT_operator_delete(void *mem)
int CDECL _heapwalk(struct MSVCRT__heapinfo *next)
MSVCRT_size_t CDECL _msize(void *mem)
static unsigned int MSVCRT_amblksiz
static MSVCRT_new_handler_func MSVCRT_new_handler
#define ALIGN_PTR(ptr, alignment, offset)
void CDECL _aligned_free(void *memblock)
int CDECL MSVCRT__query_new_mode(void)
int CDECL MSVCRT__set_new_mode(int mode)
#define MSVCRT__HEAPBADBEGIN
static BOOL msvcrt_heap_free(void *ptr)
int CDECL _heapadd(void *mem, MSVCRT_size_t size)
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
#define PROCESS_HEAP_UNCOMMITTED_RANGE
DWORD WINAPI GetLastError(void)
#define PROCESS_HEAP_ENTRY_BUSY
#define PROCESS_HEAP_REGION