Commit Graph

19 Commits

Author SHA1 Message Date
dankan1890
361d32d37f Small code cleanup:
- corealloc.h: added macro definition for global_alloc (nothrow) memory allocation.
- textbuf.cpp / wavwrite.cpp: removed pointless cast.
- debugcmd.cpp / luaengine.cpp / render.cpp: avoid strlen calls in a loop.
- diimage.cpp: simplified "device_image_interface::set_image_filename" function.
- miscmenu.cpp / selgame.h / video.cpp(h): replaced int with bool where applicable.
- ui.cpp: removed unused code.
2016-01-29 00:43:18 +01:00
Miodrag Milanovic
b1d6f6d63f Cleanups and version bump 2016-01-27 08:12:00 +01:00
Miodrag Milanovic
0da7a86a8c make make make_unique_clear accept all kind of parameters (nw) 2016-01-08 13:38:18 +01:00
Miodrag Milanovic
ce75a5d682 removed memory tracking (nw) 2016-01-08 12:41:13 +01:00
balr0g
a9b60b05ac Add realloc implementation as required by the C standard (nw) 2016-01-02 11:39:37 -05:00
Miodrag Milanovic
4ae8e7fb88 Revert "Comment this, so OSX can compile"
This reverts commit 2a6af208d6.
2016-01-01 20:13:17 +01:00
Miodrag Milanovic
2a6af208d6 Comment this, so OSX can compile 2016-01-01 18:10:27 +01:00
Miodrag Milanovic
f9353d493b Fix to make VS2015 release builds possible (nw) 2015-10-24 13:42:15 +02:00
balr0g
49bbeae98e Revert "Placed back old corealloc otherwise NO_MEM_TRACKING do not have any meaning (nw)"
(Requested by R.Belmont since this breaks build with GCC 5.1.)
This reverts commit aae343fced.
2015-06-07 15:35:00 -04:00
balr0g
021aa9eb6c Nope. (nw)
This reverts commit 72794f8ff1.
At least this provides a more useful stacktrace, if anyone wants to
debug.
2015-06-07 12:25:38 -04:00
balr0g
72794f8ff1 Use attribute unused for inlined new/delete. (nw)
This is still not compliant code, and will probably break with LTO,
but is a cleaner fix for the warning. Using this attribute also ensures
that the linker doesn't remove the code.
2015-06-07 12:02:20 -04:00
Miodrag Milanovic
aae343fced Placed back old corealloc otherwise NO_MEM_TRACKING do not have any meaning (nw) 2015-06-07 11:35:28 +02:00
balr0g
3c5998b7ee Mark replacements separate from overloads and remove unneeded prototypes (nw) 2015-05-16 17:13:01 -04:00
balr0g
79e17d0ad3 Remove nonstandard inline overloads (nw) 2015-05-16 15:57:07 -04:00
Oliver Stöneberg
5de2a39c86 re-applied safe corealloc changes (nw) 2014-05-16 11:33:39 +00:00
Scott Stone
4762e3a38f Revert of r30457 per Micko (nw) 2014-05-15 19:06:32 +00:00
Oliver Stöneberg
36ad612f60 corealloc adjustments:
- re-enabled default memory initialization in DEBUG builds (should make random crashes less random)
- moved defines from header to source since they are only used locally and not globally
- added file/line information to global_free* and fixed src/emu/sound/spu.c compilation
2014-05-15 12:09:20 +00:00
Oliver Stöneberg
c8ea1c0d04 fixed GCC/clang compilation / fixed some forward declarations (nw) 2014-03-11 17:13:40 +00:00
Aaron Giles
4ea9df02a1 Moved core template container classes up from emutempl.h to coretmpl.h:
[Aaron Giles]
 * these classes now no longer take a resource_pool; everything is
    managed globally -- this means that objects added to lists must be
    allocated with global_alloc
 * added new auto_pointer<> template which wraps a pointer and auto-frees
    it upon destruction; it also defaults to NULL so it doesn't need to
    be explicitly initialized
 * moved tagged_list template to tagmap.h

Redo of the low-level memory tracking system: [Aaron Giles]
 * moved low-level tracking out of emu\emualloc into lib\util\corealloc
    so it can be shared among all components and used by core libraries
 * global_alloc and friends no longer use a resource pool to track
    allocations; turns out this was a wholly redundant system that wasted
    a lot of memory
 * removed global_resource_pool entirely
 * added global_free_array to delete arrays allocated with 
    global_alloc_array
 * added tracking of object versus array allocation; we will now error
    if you use global_free on an array, or global_free_array on an object

Added new utility helper const_string_pool which can be used to 
efficiently accumulate strings that are not intended to be modified.
Used by updated makelist and software list code. [Aaron Giles]

Updated png2bdc and makelist tools to not leak memory and use more modern
techniques (no more MAX_DRIVERS in makelist, for example). [Aaron Giles]

Deprecated auto_strdup and removed all uses by way of caller-managed 
astrings and the software list rewrite. [Aaron Giles]

Rewrote software list management: [Aaron Giles]
 * removed the notion of a software_list that is separate from a
    software_list_device; they are one and the same now
 * moved several functions into device_image_interface since they really
    didn't belong in the core software list class
 * lots of simplification as a result of the above changes

Additional notes (no whatsnew):

Moved definition of FPTR to osdcomm.h.

Some changes happened in the OSD code to fix issues, especially regarding
freeing arrays. SDL folks may need to fix up some of these.

The following devices still are using tokens and should be modernized
(I found them because they kept their token as void * and tried to
delete it, which you can't):

namco_52xx_device (mame/audio/namco52.c)
namco_54xx_device (mame/audio/namco54.c)
namco_06xx_device (mame/machine/namco06.c)
namco_50xx_device (mame/machine/namco50.c)
namco_51xx_device (mame/machine/namco51.c)
namco_53xx_device (mame/machine/namco53.c)
voodoo_device (emu/video/voodoo.c)
mos6581_device (emu/sound/mos6581.c)
aica_device (emu/sound/aica.c)
scsp_device (emu/sound/scsp.c)
dmadac_sound_device (emu/sound/dmadac.c)
s3c2440_device (emu/machine/s3c2440.c)
wd1770_device (emu/machine/wd17xx.c)
latch8_device (emu/machine/latch8.c)
duart68681_device (emu/machine/68681.c)
s3c2400_device (emu/machine/s3c2400.c)
s3c2410_device (emu/machine/s3c2410.c)
strataflash_device (mess/machine/strata.c)
hd63450_device (mess/machine/hd63450.c)
tap_990_device (mess/machine/ti99/990_tap.c)
omti8621_device (mess/machine/omti8621.c)
vdt911_device (mess/video/911_vdt.c)
apollo_graphics_15i (mess/video/apollo.c)
asr733_device (mess/video/733_asr.c)
2014-03-11 15:54:58 +00:00