Commit Graph

10 Commits

Author SHA1 Message Date
AJR
a77adf33c7 dvmemory: Substitute strongly typed enum for magic numbers specifying data format 2021-08-16 14:05:22 -04:00
Vas Crabb
4f05917494 Got rid of global_alloc/global_free.
The global_alloc/global_free functions have outlived their usefulness.
They don't allow consistently overriding the default memory allocation
behaviour because they aren't used consistently, and we don't have
standard library allocator wrappers for them that we'd need to use them
consistently with all the standard library containers we're using.  If
you need to change the default allocator behaviour, you can override the
new/delete operators, and there are ways to get more fine-grained
control that way.  We're already doing that to pre-fill memory in debug
builds.

Code was already starting to depend on global_alloc/global_free wrapping
new/delete.  For example some parts of the code (including the UI and
Windows debugger) was putting the result of global_alloc in a
std::unique_ptr wrappers without custom deleters, and the SPU sound
device was assuming it could use global_free to release memory allocated
with operator new.  There was also code misunderstanding the behaviour
of global_alloc, for example the GROM port cartridge code was checking
for nullptr when a failure will actually throw std::bad_alloc.

As well as substituting new/delete, I've made several things use smart
pointers to reduce the chance of leaks, and fixed a couple of leaks,
too.
2020-10-03 03:00:24 +10:00
Oliver Stöneberg
dfaf9dd5bc
fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) 2020-01-30 21:46:27 -05:00
npwoods
2af3233101 Changed a few 'const char *' ==> 'const std::string &' in the MAME debugger (#2170) 2017-06-24 09:46:58 +10:00
Miodrag Milanovic
aa83c19e77 fix windows compile (nw) 2017-02-11 19:27:17 +01:00
Miodrag Milanovic
89c5e1f681 Various cleanups suggested by static analyzer (nw) 2016-04-24 12:58:31 +02:00
yz70s
e76dc64868 Show 64 and 80 bit floats in windows and qt debugger (issue #476) 2015-12-06 23:33:03 +01:00
yz70s
b052dcb402 First commit for issue #476
"byte per chunk" is sostituted by "data format"
  data formats lesser than 9 work as before, data format 9 is 32 but floating point
  in the debug_view_memory class method bytes_per_chunk is substituted by get_data_format, set_bytes_per_chunk is substituted by set_data_format
  floating point values cannot be edited
  currently floating point values are available only in the windows debugger, next commit will add them to the qt debugger, osx i won't be able to do it
  afterwards 64 and 80 bit formats will be added
2015-11-30 10:15:25 +01:00
Miodrag Milanovic
02f128df25 more cleanups and fix (nw) 2015-11-11 17:19:26 +01:00
Miodrag Milanovic
7c19aac60e Rename *.c -> *.cpp in our source (nw) 2015-11-08 12:56:12 +01:00