summaryrefslogtreecommitdiffstatshomepage
path: root/src/ldplayer/ldplayer.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-04-26 23:54:37 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-04-26 23:54:37 +0000
commitad4910a8a8c0b1ca6930eee35121fe18aca84cd3 (patch)
treedab6938694ab159063c0f5f6496e98ea51efd42e /src/ldplayer/ldplayer.c
parent7c137ce2a7194bee4dab2e341595898b3410d74d (diff)
Bulk change alert.
This update changes the way we handle memory allocation. Rather than allocating in terms of bytes, allocations are now done in terms of objects. This is done via new set of macros that replace the malloc_or_die() macro: alloc_or_die(t) - allocate memory for an object of type 't' alloc_array_or_die(t,c) - allocate memory for an array of 'c' objects of type 't' alloc_clear_or_die(t) - same as alloc_or_die but memset's the memory to 0 alloc_array_clear_or_die(t,c) - same as alloc_array_or_die but memset's the memory to 0 All original callers of malloc_or_die have been updated to call these new macros. If you just need an array of bytes, you can use alloc_array_or_die(UINT8, numbytes). Made a similar change to the auto_* allocation macros. In addition, added 'machine' as a required parameter to the auto-allocation macros, as the resource pools will eventually be owned by the machine object. The new macros are: auto_alloc(m,t) - allocate memory for an object of type 't' auto_alloc_array(m,t,c) - allocate memory for an array of 'c' objects of type 't' auto_alloc_clear(m,t) - allocate and memset auto_alloc_array_clear(m,t,c) - allocate and memset All original calls or auto_malloc have been updated to use the new macros. In addition, auto_realloc(), auto_strdup(), auto_astring_alloc(), and auto_bitmap_alloc() have been updated to take a machine parameter. Changed validity check allocations to not rely on auto_alloc* anymore because they are not done in the context of a machine. One final change that is included is the removal of SMH_BANKn macros. Just use SMH_BANK(n) instead, which is what the previous macros mapped to anyhow.
Diffstat (limited to 'src/ldplayer/ldplayer.c')
-rw-r--r--src/ldplayer/ldplayer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c
index 14995fe0449..3be984e31a5 100644
--- a/src/ldplayer/ldplayer.c
+++ b/src/ldplayer/ldplayer.c
@@ -122,7 +122,7 @@ static chd_file *get_disc(const device_config *device)
chderr = chd_open_file(mame_core_file(image_file), CHD_OPEN_READ, NULL, &image_chd);
if (chderr == CHDERR_NONE)
{
- set_disk_handle("laserdisc", image_file, image_chd);
+ set_disk_handle(device->machine, "laserdisc", image_file, image_chd);
filename = astring_dupc(dir->name);
add_exit_callback(device->machine, free_string);
break;