summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-12-29 16:09:32 -0500
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-12-29 16:09:32 -0500
commitb73bce6484169bb7dc1efedf29b35476848ab871 (patch)
treecf11dcd02f654f4c34091bcf69e4f9cfb2785a74
parent4a09c92a14da4e3c04acfa8adafb783e2d860cf3 (diff)
voodoo: Eliminate auto_alloc (nw)
-rw-r--r--src/devices/video/voodoo.cpp10
-rw-r--r--src/devices/video/voodoo.h5
2 files changed, 9 insertions, 6 deletions
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index 8e4a6215b2f..2040f8dc148 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -5621,7 +5621,7 @@ void voodoo_device::device_start()
/* create a multiprocessor work queue */
poly = poly_alloc(machine(), 64, sizeof(poly_extra_data), 0);
- thread_stats = auto_alloc_array(machine(), stats_block, WORK_MAX_THREADS);
+ thread_stats = std::make_unique<stats_block[]>(WORK_MAX_THREADS);
/* create a table of precomputed 1/n and log2(n) values */
/* n ranges from 1.0000 to 2.0000 */
@@ -5726,14 +5726,14 @@ void voodoo_device::device_start()
if (vd_type <= TYPE_VOODOO_2)
{
/* separate FB/TMU memory */
- fbmem = auto_alloc_array(machine(), uint8_t, m_fbmem << 20);
- tmumem[0] = auto_alloc_array(machine(), uint8_t, m_tmumem0 << 20);
- tmumem[1] = (m_tmumem1 != 0) ? auto_alloc_array(machine(), uint8_t, m_tmumem1 << 20) : nullptr;
+ fbmem = (m_fbmem_alloc = std::make_unique<uint8_t[]>(m_fbmem << 20)).get();
+ tmumem[0] = (m_tmumem_alloc[0] = std::make_unique<uint8_t[]>(m_tmumem0 << 20)).get();
+ tmumem[1] = (m_tmumem1 != 0) ? (m_tmumem_alloc[1] = std::make_unique<uint8_t[]>(m_tmumem1 << 20)).get() : nullptr;
}
else
{
/* shared memory */
- tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(machine(), uint8_t, m_fbmem << 20);
+ tmumem[0] = tmumem[1] = fbmem = (m_fbmem_alloc = std::make_unique<uint8_t[]>(m_fbmem << 20)).get();
tmumem0 = m_fbmem;
if (vd_type == TYPE_VOODOO_3)
tmumem1 = m_fbmem;
diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h
index c8b74b90813..b6ef2abc8cf 100644
--- a/src/devices/video/voodoo.h
+++ b/src/devices/video/voodoo.h
@@ -1311,6 +1311,9 @@ public:
optional_device<screen_device> m_screen_finder; // the screen we are acting on
optional_device<cpu_device> m_cpu_finder; // the CPU we interact with
+ std::unique_ptr<uint8_t[]> m_fbmem_alloc;
+ std::unique_ptr<uint8_t[]> m_tmumem_alloc[2];
+
uint8_t index; // index of board
screen_device * m_screen; // the screen we are acting on
cpu_device * m_cpu; // the CPU we interact with
@@ -1335,7 +1338,7 @@ public:
banshee_info banshee; // Banshee state
legacy_poly_manager * poly; // polygon manager
- stats_block * thread_stats; // per-thread statistics
+ std::unique_ptr<stats_block[]> thread_stats; // per-thread statistics
voodoo_stats stats; // internal statistics