mirror of
https://github.com/holub/mame
synced 2025-05-16 10:52:43 +03:00
emualloc.h: Force inlining of MAME's new and delete operators.
This commit is contained in:
parent
84cdaed285
commit
1d4ea432e9
@ -204,7 +204,7 @@ void dump_unfreed_mem();
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
// standard new/delete operators (try to avoid using)
|
// standard new/delete operators (try to avoid using)
|
||||||
inline void *operator new(std::size_t size) throw (std::bad_alloc)
|
ATTR_FORCE_INLINE inline void *operator new(std::size_t size) throw (std::bad_alloc)
|
||||||
{
|
{
|
||||||
void *result = malloc_file_line(size, NULL, 0);
|
void *result = malloc_file_line(size, NULL, 0);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@ -212,7 +212,7 @@ inline void *operator new(std::size_t size) throw (std::bad_alloc)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void *operator new[](std::size_t size) throw (std::bad_alloc)
|
ATTR_FORCE_INLINE inline void *operator new[](std::size_t size) throw (std::bad_alloc)
|
||||||
{
|
{
|
||||||
void *result = malloc_file_line(size, NULL, 0);
|
void *result = malloc_file_line(size, NULL, 0);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@ -220,13 +220,13 @@ inline void *operator new[](std::size_t size) throw (std::bad_alloc)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete(void *ptr) throw()
|
ATTR_FORCE_INLINE inline void operator delete(void *ptr) throw()
|
||||||
{
|
{
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
free_file_line(ptr, NULL, 0);
|
free_file_line(ptr, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete[](void *ptr) throw()
|
ATTR_FORCE_INLINE inline void operator delete[](void *ptr) throw()
|
||||||
{
|
{
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
free_file_line(ptr, NULL, 0);
|
free_file_line(ptr, NULL, 0);
|
||||||
@ -234,7 +234,7 @@ inline void operator delete[](void *ptr) throw()
|
|||||||
|
|
||||||
|
|
||||||
// file/line new/delete operators
|
// file/line new/delete operators
|
||||||
inline void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc)
|
ATTR_FORCE_INLINE inline void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc)
|
||||||
{
|
{
|
||||||
void *result = malloc_file_line(size, file, line);
|
void *result = malloc_file_line(size, file, line);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@ -242,7 +242,7 @@ inline void *operator new(std::size_t size, const char *file, int line) throw (s
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc)
|
ATTR_FORCE_INLINE inline void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc)
|
||||||
{
|
{
|
||||||
void *result = malloc_file_line(size, file, line);
|
void *result = malloc_file_line(size, file, line);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@ -250,13 +250,13 @@ inline void *operator new[](std::size_t size, const char *file, int line) throw
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete(void *ptr, const char *file, int line)
|
ATTR_FORCE_INLINE inline void operator delete(void *ptr, const char *file, int line)
|
||||||
{
|
{
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
free_file_line(ptr, file, line);
|
free_file_line(ptr, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete[](void *ptr, const char *file, int line)
|
ATTR_FORCE_INLINE inline void operator delete[](void *ptr, const char *file, int line)
|
||||||
{
|
{
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
free_file_line(ptr, file, line);
|
free_file_line(ptr, file, line);
|
||||||
@ -264,7 +264,7 @@ inline void operator delete[](void *ptr, const char *file, int line)
|
|||||||
|
|
||||||
|
|
||||||
// file/line new/delete operators with zeroing
|
// file/line new/delete operators with zeroing
|
||||||
inline void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc)
|
ATTR_FORCE_INLINE inline void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc)
|
||||||
{
|
{
|
||||||
void *result = malloc_file_line(size, file, line);
|
void *result = malloc_file_line(size, file, line);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@ -273,7 +273,7 @@ inline void *operator new(std::size_t size, const char *file, int line, const ze
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc)
|
ATTR_FORCE_INLINE inline void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc)
|
||||||
{
|
{
|
||||||
void *result = malloc_file_line(size, file, line);
|
void *result = malloc_file_line(size, file, line);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@ -282,13 +282,13 @@ inline void *operator new[](std::size_t size, const char *file, int line, const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete(void *ptr, const char *file, int line, const zeromem_t &)
|
ATTR_FORCE_INLINE inline void operator delete(void *ptr, const char *file, int line, const zeromem_t &)
|
||||||
{
|
{
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
free_file_line(ptr, file, line);
|
free_file_line(ptr, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete[](void *ptr, const char *file, int line, const zeromem_t &)
|
ATTR_FORCE_INLINE inline void operator delete[](void *ptr, const char *file, int line, const zeromem_t &)
|
||||||
{
|
{
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
free_file_line(ptr, file, line);
|
free_file_line(ptr, file, line);
|
||||||
|
Loading…
Reference in New Issue
Block a user