mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
Removed memory allocation calls from image device (no whatsnew)
This commit is contained in:
parent
5268e8a68b
commit
45dd274257
@ -39,7 +39,6 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "ui.h"
|
||||
#include "pool.h"
|
||||
#include "zippath.h"
|
||||
|
||||
|
||||
@ -70,16 +69,6 @@ const image_device_type_info device_image_interface::m_device_info_array[] =
|
||||
// DEVICE IMAGE INTERFACE
|
||||
//**************************************************************************
|
||||
|
||||
/*-------------------------------------------------
|
||||
memory_error - report a memory error
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void memory_error(const char *message)
|
||||
{
|
||||
fatalerror("%s", message);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_image_interface - constructor
|
||||
//-------------------------------------------------
|
||||
@ -94,7 +83,6 @@ device_image_interface::device_image_interface(const machine_config &mconfig, de
|
||||
m_readonly(false),
|
||||
m_created(false)
|
||||
{
|
||||
m_mempool = pool_alloc_lib(memory_error);
|
||||
}
|
||||
|
||||
|
||||
@ -104,7 +92,6 @@ device_image_interface::device_image_interface(const machine_config &mconfig, de
|
||||
|
||||
device_image_interface::~device_image_interface()
|
||||
{
|
||||
pool_free_lib(m_mempool);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -449,35 +436,6 @@ const char *device_image_interface::get_feature(const char *feature_name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Memory allocators
|
||||
|
||||
These allow memory to be allocated for the lifetime of a mounted image.
|
||||
If these (and the above accessors) are used well enough, they should be
|
||||
able to eliminate the need for a unload function.
|
||||
****************************************************************************/
|
||||
|
||||
void *device_image_interface::image_malloc(size_t size)
|
||||
{
|
||||
return image_realloc(NULL, size);
|
||||
}
|
||||
|
||||
char *device_image_interface::image_strdup(const char *src)
|
||||
{
|
||||
return pool_strdup_lib(m_mempool, src);
|
||||
}
|
||||
|
||||
void *device_image_interface::image_realloc(void *ptr, size_t size)
|
||||
{
|
||||
return pool_realloc_lib(m_mempool, ptr, size);
|
||||
}
|
||||
|
||||
void device_image_interface::image_freeptr(void *ptr)
|
||||
{
|
||||
pool_object_remove(m_mempool, ptr, 0);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Hash info loading
|
||||
|
||||
|
@ -46,8 +46,6 @@
|
||||
#ifndef __DIIMAGE_H__
|
||||
#define __DIIMAGE_H__
|
||||
|
||||
#include "pool.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
@ -245,11 +243,6 @@ public:
|
||||
UINT32 get_software_region_length(const char *tag);
|
||||
const char *get_feature(const char *feature_name);
|
||||
|
||||
void *image_malloc(size_t size);
|
||||
char *image_strdup(const char *src);
|
||||
void *image_realloc(void *ptr, size_t size);
|
||||
void image_freeptr(void *ptr);
|
||||
|
||||
UINT32 crc();
|
||||
hash_collection& hash() { return m_hash; }
|
||||
|
||||
@ -310,8 +303,6 @@ protected:
|
||||
int m_create_format;
|
||||
option_resolution *m_create_args;
|
||||
|
||||
object_pool *m_mempool;
|
||||
|
||||
hash_collection m_hash;
|
||||
};
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "uimenu.h"
|
||||
#include "expat.h"
|
||||
#include "pool.h"
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user