Commit Graph

16 Commits

Author SHA1 Message Date
Aaron Giles
eb79c00418 Wrapped the global_resource_pool into a function in an attempt to
ensure it is initialized before anyone that references it.
2012-01-26 20:35:51 +00:00
Aaron Giles
49f15acb7d tagmap is just a C++ template now. Added iterators to it as
well. Updated a few outlying uses.
2012-01-17 19:06:55 +00:00
Miodrag Milanovic
7e070aec5b Added possibility of disabling memory tracking when using some external libraries in osd layer (no whatsnew) 2011-10-11 11:26:59 +00:00
Aaron Giles
932a42eac4 Be consistent about template argument naming. 2011-04-30 20:37:06 +00:00
Aaron Giles
a0647e8e68 Use much bigger hash tables for memory allocations now that we are
allocating lots of small objects. Previous size was scaling poorly
and taking a lot of time to free, causing things like -listxml
and -validate to be a lot slower than before since the new 
driver_enumerator actually frees all of its memory at the end.

Also changed resource_pool to support a hash table size as input to
the constructor, which allows the global pool to be large, while
the machine-local pools can remain smaller.
2011-04-19 15:08:42 +00:00
Aaron Giles
00d745ca77 (Big tangle of changes that all happened as I was looking into the ROM
loader rewrite, which is still in progress....)

Replaced mamedriv.c with a new driver list mechanism that is generated
by the build tools. The emulator core now expects the presence of a
file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of
driver names, one per line. C and C++ comments are still permitted.
This file is parsed by a new build tool makelist which extracts the
driver names, sorts them, and generates a file called drivlist.c, which
is consumed by the core. [Aaron Giles]

Added new osdcore function osd_malloc_array() which is identical to
osd_malloc() but obviously hints that the underlying allocation is for
an array. Updated all callers to use the appropriate form. Modified the
Windows allocator to only use guard pages for array-style allocations,
allowing us to enable them once again in debug builds. [Aaron Giles]

Created new static class driver_list to wrap accesses to the list of
available drivers. Improved speed of driver lookups by relying on the
presorting done by makelist. [Aaron Giles]

Created helper class driver_enumerator as a helper for iterating through 
the list of drivers. This class supports basic filtering and iteration,
and also serves as a temporary cache of machine_configs. [Aaron Giles]

Created cli_frontend object to wrap all the CLI handling code in
clifront.c. Updated/simplified all the code to take advantage of the
driver_enumerator. [Aaron Giles]

Created media_auditor object to wrap all the auditing functions in
audit.c. Updated all users to the new interface. Note that the new
auditing mechanism is slightly out of sync with the romload code in
terms of finding ROMs owned by devices, so it may mis-report some
issues until the new ROM loading code is in. [Aaron Giles]

Added concept of a per-device searchpath. For most devices, their 
searchpath is just the short name of the device. For driver_devices, the
searchpath is driver[;parent[;bios]]. This searchpath will eventually be
used by the rom loader to find ROMs. For now it is used by the media
auditor only. [Aaron Giles]

Created info_xml_creator object to wrap all the info generation functions
in info.c. Converted the file to C++ and cleaned up the input processing
code. [Aaron Giles]

(not for whatsnew ... Known issues: auditing of CHDs appears busted, and 
debug builds report unfreed memory if you use the built-in game picker)
2011-04-13 20:31:00 +00:00
Aaron Giles
46550a475b Non-debug builds need to free those memory_entries. Fixes enormous
memory consumption when iterating through all drivers like -romident
does.

Also moved softlist scanning into the main loop so that machine_configs
are only constructed once.
2011-03-10 07:06:21 +00:00
Wilbert Pol
1d4ea432e9 emualloc.h: Force inlining of MAME's new and delete operators. 2010-10-16 18:17:00 +00:00
R. Belmont
29149cf734 More Clang fixes (verified OK with GCC) [Balrog] 2010-10-16 03:17:49 +00:00
Aaron Giles
3beb0ec246 Converted render.c objects into C++ objects. Updated all callers. 2010-10-13 06:20:10 +00:00
Aaron Giles
29b6b0de41 C++-ified the debugger views. Not quite architecturally where I would
like them, but it's a start. Split implementation of individual view
types out to separate files. Updated all callers.

Also:
 * fixed okim6295 memory view
 * changed emualloc to free resource pools from earliest to latest
    so that early objects can safely clean up stuff they allocated
2010-06-25 05:11:42 +00:00
Aaron Giles
c3bb16d573 Moved global new/delete operators into inlines in emualloc.h
to avoid link errors with certain architectures. [couriersud]

Some minor cleanup/normalizing of emualloc in general.
[Aaron Giles]
2010-02-14 21:44:50 +00:00
Aaron Giles
aebc07a897 Cleanups and version bump. 2010-01-16 04:12:04 +00:00
Aaron Giles
a9c5a5a27e Fixed memory freeing so that is it released in the opposite order
it was originally allocated.

Changed machine->region() to return a pointer to the now-public
region_info class.

Added new member function space() to the device_config, along with
shorter constants to be used (AS_PROGRAM, AS_DATA, AS_IO). With no 
parameters, space() returns the first address space, which is 
commonly the only space present. Updated a few devices that referenced 
the old space[] array to call the new function instead.

Added #define to emualloc to ensure delete can't be freely used.
2010-01-11 18:02:38 +00:00
Aaron Giles
8e261f62c8 Re-enabled malloc/free but routed them to the file+line versions. 2010-01-08 08:24:22 +00:00
Aaron Giles
ab68710ce5 Oops, forgot these files. 2010-01-08 06:11:00 +00:00