Commit 3a86f0a6 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Remove MSVCRT_ prefix from new() and delete().

parent 6cca4e25
......@@ -58,8 +58,8 @@ DEFINE_VTBL_WRAPPER(56);
/* ?_Fpz@std@@3_JB */
const __int64 std_Fpz = 0;
void* (__cdecl *MSVCRT_operator_new)(size_t);
void (__cdecl *MSVCRT_operator_delete)(void*);
void* (__cdecl *operator_new)(size_t);
void (__cdecl *operator_delete)(void*);
void* (__cdecl *MSVCRT_set_new_handler)(void*);
static void init_cxx_funcs(void)
......@@ -68,14 +68,14 @@ static void init_cxx_funcs(void)
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
{
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z");
}
else
{
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z");
}
}
......
......@@ -32,8 +32,8 @@ void __cdecl _invalid_parameter(const wchar_t*, const wchar_t*,
const wchar_t*, unsigned int, uintptr_t);
BOOL __cdecl __uncaught_exception(void);
extern void* (__cdecl *MSVCRT_operator_new)(size_t);
extern void (__cdecl *MSVCRT_operator_delete)(void*);
extern void* (__cdecl *operator_new)(size_t);
extern void (__cdecl *operator_delete)(void*);
/* basic_string<char, char_traits<char>, allocator<char>> */
typedef struct
......
......@@ -100,7 +100,7 @@ _Concurrent_queue_base_v4* __thiscall _Concurrent_queue_base_v4_ctor(
{
TRACE("(%p %Iu)\n", this, size);
this->data = MSVCRT_operator_new(sizeof(*this->data));
this->data = operator_new(sizeof(*this->data));
memset(this->data, 0, sizeof(*this->data));
this->vtable = &_Concurrent_queue_base_v4_vtable;
......@@ -122,7 +122,7 @@ DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4_dtor, 4)
void __thiscall _Concurrent_queue_base_v4_dtor(_Concurrent_queue_base_v4 *this)
{
TRACE("(%p)\n", this);
MSVCRT_operator_delete(this->data);
operator_delete(this->data);
}
DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4_vector_dtor, 8)
......@@ -136,11 +136,11 @@ _Concurrent_queue_base_v4* __thiscall _Concurrent_queue_base_v4_vector_dtor(
for(i=*ptr-1; i>=0; i--)
_Concurrent_queue_base_v4_dtor(this+i);
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
} else {
if(flags & 1)
_Concurrent_queue_base_v4_dtor(this);
MSVCRT_operator_delete(this);
operator_delete(this);
}
return this;
......
......@@ -133,11 +133,11 @@ void * __thiscall MSVCP_exception_vector_dtor(exception *this, unsigned int flag
for(i=*ptr-1; i>=0; i--)
MSVCP_exception_dtor(this+i);
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
} else {
MSVCP_exception_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
operator_delete(this);
}
return this;
......@@ -149,7 +149,7 @@ void * __thiscall MSVCP_exception_scalar_dtor(exception *this, unsigned int flag
{
TRACE("(%p %x)\n", this, flags);
MSVCP_exception_dtor(this);
if (flags & 1) MSVCRT_operator_delete(this);
if (flags & 1) operator_delete(this);
return this;
}
......@@ -249,11 +249,11 @@ void * __thiscall MSVCP_bad_alloc_vector_dtor(bad_alloc *this, unsigned int flag
for(i=*ptr-1; i>=0; i--)
MSVCP_bad_alloc_dtor(this+i);
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
} else {
MSVCP_bad_alloc_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
operator_delete(this);
}
return this;
......@@ -353,11 +353,11 @@ void* __thiscall MSVCP_logic_error_vector_dtor(
for(i=*ptr-1; i>=0; i--)
MSVCP_logic_error_dtor(this+i);
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
} else {
MSVCP_logic_error_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
operator_delete(this);
}
return this;
......@@ -369,7 +369,7 @@ void * __thiscall MSVCP_logic_error_scalar_dtor(logic_error *this, unsigned int
{
TRACE("(%p %x)\n", this, flags);
MSVCP_logic_error_dtor(this);
if (flags & 1) MSVCRT_operator_delete(this);
if (flags & 1) operator_delete(this);
return this;
}
......@@ -597,11 +597,11 @@ void* __thiscall MSVCP_runtime_error_vector_dtor(
for(i=*ptr-1; i>=0; i--)
MSVCP_runtime_error_dtor(this+i);
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
} else {
MSVCP_runtime_error_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
operator_delete(this);
}
return this;
......@@ -793,11 +793,11 @@ void * __thiscall MSVCP_bad_cast_vector_dtor(bad_cast *this, unsigned int flags)
for(i=*ptr-1; i>=0; i--)
MSVCP_bad_cast_dtor(this+i);
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
} else {
MSVCP_bad_cast_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
operator_delete(this);
}
return this;
......
......@@ -70,7 +70,7 @@ void* __thiscall MSVCP_allocator_char_assign(void *this, const void *assign)
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_deallocate, 12)
void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t size)
{
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
}
/* ?allocate@?$allocator@D@std@@QAEPADI@Z */
......@@ -78,7 +78,7 @@ void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t si
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate, 8)
char* __thiscall MSVCP_allocator_char_allocate(void *this, size_t count)
{
return MSVCRT_operator_new(count);
return operator_new(count);
}
/* ?allocate@?$allocator@D@std@@QAEPADIPBX@Z */
......@@ -162,7 +162,7 @@ DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_deallocate, 12)
void __thiscall MSVCP_allocator_wchar_deallocate(void *this,
wchar_t *ptr, size_t size)
{
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
}
/* ?allocate@?$allocator@_W@std@@QAEPA_WI@Z */
......@@ -175,7 +175,7 @@ wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, size_t count)
return NULL;
}
return MSVCRT_operator_new(count * sizeof(wchar_t));
return operator_new(count * sizeof(wchar_t));
}
/* ?allocate@?$allocator@_W@std@@QAEPA_WIPBX@Z */
......@@ -260,7 +260,7 @@ DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_deallocate, 12)
void __thiscall MSVCP_allocator_short_deallocate(void *this,
unsigned short *ptr, size_t size)
{
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
}
/* ?allocate@?$allocator@G@std@@QAEPAGI@Z */
......@@ -274,7 +274,7 @@ unsigned short* __thiscall MSVCP_allocator_short_allocate(
return NULL;
}
return MSVCRT_operator_new(count * sizeof(unsigned short));
return operator_new(count * sizeof(unsigned short));
}
/* ?allocate@?$allocator@G@std@@QAEPAGIPBX@Z */
......
......@@ -262,7 +262,7 @@ typedef struct __Container_proxy {
DEFINE_THISCALL_WRAPPER(mutex_ctor, 4)
mutex* __thiscall mutex_ctor(mutex *this)
{
CRITICAL_SECTION *cs = MSVCRT_operator_new(sizeof(*cs));
CRITICAL_SECTION *cs = operator_new(sizeof(*cs));
if(!cs) {
ERR("Out of memory\n");
throw_exception(EXCEPTION_BAD_ALLOC, NULL);
......@@ -281,7 +281,7 @@ void __thiscall mutex_dtor(mutex *this)
{
((CRITICAL_SECTION*)this->mutex)->DebugInfo->Spare[0] = 0;
DeleteCriticalSection(this->mutex);
MSVCRT_operator_delete(this->mutex);
operator_delete(this->mutex);
}
/* ?_Lock@_Mutex@std@@QAEXXZ */
......@@ -765,7 +765,7 @@ void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int flags)
int __cdecl _Mtx_init(_Mtx_t *mtx, int flags)
{
*mtx = MSVCRT_operator_new(sizeof(**mtx));
*mtx = operator_new(sizeof(**mtx));
_Mtx_init_in_situ(*mtx, flags);
return 0;
}
......@@ -778,7 +778,7 @@ void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx)
void __cdecl _Mtx_destroy(_Mtx_arg_t mtx)
{
call_func1(critical_section_dtor, &MTX_T_FROM_ARG(mtx)->cs);
MSVCRT_operator_delete(MTX_T_FROM_ARG(mtx));
operator_delete(MTX_T_FROM_ARG(mtx));
}
int __cdecl _Mtx_current_owns(_Mtx_arg_t mtx)
......@@ -875,7 +875,7 @@ void __cdecl _Cnd_init_in_situ(_Cnd_t cnd)
int __cdecl _Cnd_init(_Cnd_t *cnd)
{
*cnd = MSVCRT_operator_new(sizeof(**cnd));
*cnd = operator_new(sizeof(**cnd));
_Cnd_init_in_situ(*cnd);
return 0;
}
......@@ -940,7 +940,7 @@ void __cdecl _Cnd_destroy(_Cnd_arg_t cnd)
{
if(cnd) {
_Cnd_broadcast(cnd);
MSVCRT_operator_delete(CND_T_FROM_ARG(cnd));
operator_delete(CND_T_FROM_ARG(cnd));
}
}
......@@ -1075,10 +1075,10 @@ custom_category* __thiscall custom_category_vector_dtor(custom_category *this, u
INT_PTR i, *ptr = (INT_PTR *)this-1;
for(i=*ptr-1; i>=0; i--)
MSVCRT_operator_delete(ptr);
operator_delete(ptr);
} else {
if(flags & 1)
MSVCRT_operator_delete(this);
operator_delete(this);
}
return this;
......@@ -1624,7 +1624,7 @@ LONGLONG __cdecl _Query_perf_frequency(void)
void __cdecl threads__Mtx_new(void **mtx)
{
*mtx = MSVCRT_operator_new(sizeof(CRITICAL_SECTION));
*mtx = operator_new(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(*mtx);
}
......
......@@ -41,8 +41,13 @@ void __cdecl _invalid_parameter_noinfo(void);
BOOL __cdecl __uncaught_exception(void);
int __cdecl _callnewh(size_t);
extern void* (__cdecl *MSVCRT_operator_new)(size_t);
extern void (__cdecl *MSVCRT_operator_delete)(void*);
#if _MSVCP_VER >= 140
void* __cdecl operator_new(size_t);
void __cdecl operator_delete(void*);
#else
extern void* (__cdecl *operator_new)(size_t);
extern void (__cdecl *operator_delete)(void*);
#endif
extern void* (__cdecl *MSVCRT_set_new_handler)(void*);
#if _MSVCP_VER >= 110
......
......@@ -54,8 +54,6 @@ DEFINE_VTBL_WRAPPER(56);
#endif
void* (__cdecl *MSVCRT_operator_new)(size_t);
void (__cdecl *MSVCRT_operator_delete)(void*);
void* (__cdecl *MSVCRT_set_new_handler)(void*);
#if _MSVCP_VER >= 110
......@@ -79,7 +77,7 @@ bool (__cdecl *Context_IsCurrentTaskCollectionCanceling)(void);
#endif
#if _MSVCP_VER >= 140
static void* __cdecl operator_new(size_t size)
void* __cdecl operator_new(size_t size)
{
void *retval;
int freed;
......@@ -100,7 +98,7 @@ static void* __cdecl operator_new(size_t size)
return NULL;
}
static void __cdecl operator_delete(void *mem)
void __cdecl operator_delete(void *mem)
{
TRACE("(%p)\n", mem);
free(mem);
......@@ -110,6 +108,9 @@ void __cdecl _invalid_parameter(const wchar_t *expr, const wchar_t *func, const
{
_invalid_parameter_noinfo();
}
#else
void* (__cdecl *operator_new)(size_t);
void (__cdecl *operator_delete)(void*);
#endif
static void init_cxx_funcs(void)
......@@ -122,8 +123,6 @@ static void init_cxx_funcs(void)
if (!hmod) FIXME( "%s not loaded\n", MSVCRT_NAME(_MSVCP_VER) );
#if _MSVCP_VER >= 140
MSVCRT_operator_new = operator_new;
MSVCRT_operator_delete = operator_delete;
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "_set_new_handler");
hcon = LoadLibraryA( CONCRT_NAME(_MSVCP_VER) );
......@@ -131,14 +130,14 @@ static void init_cxx_funcs(void)
#else
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
{
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z");
}
else
{
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z");
}
#endif
......
......@@ -1630,7 +1630,7 @@ void __thiscall _Yarn_char__Tidy(_Yarn_char *this)
TRACE("(%p)\n", this);
if(this->str)
MSVCRT_operator_delete(this->str);
operator_delete(this->str);
this->str = NULL;
}
......@@ -1647,7 +1647,7 @@ _Yarn_char* __thiscall _Yarn_char_op_assign_cstr(_Yarn_char *this, const char *s
if(str) {
size_t len = strlen(str);
this->str = MSVCRT_operator_new((len+1)*sizeof(char));
this->str = operator_new((len+1)*sizeof(char));
if(!this->str) {
ERR("out of memory\n");
return NULL;
......@@ -1741,7 +1741,7 @@ void __thiscall _Yarn_wchar__Tidy(_Yarn_wchar *this)
TRACE("(%p)\n", this);
if(this->str)
MSVCRT_operator_delete(this->str);
operator_delete(this->str);
this->str = NULL;
}
......@@ -1767,7 +1767,7 @@ _Yarn_wchar* __thiscall _Yarn_wchar_op_assign_cstr(_Yarn_wchar *this, const wcha
if(str) {
size_t len = wcslen(str);
this->str = MSVCRT_operator_new((len+1)*sizeof(wchar_t));
this->str = operator_new((len+1)*sizeof(wchar_t));
if(!this->str) {
ERR("out of memory\n");
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment