Commit Graph

65 Commits

Author SHA1 Message Date
Scott Stone
ca0f74f334 Fix the memory leaks with the strconv.c function by
using osd_malloc() instead.  Fixed other memory leaks as well.  [Oliver Stoneberg]
2010-04-23 17:10:03 +00:00
Aaron Giles
dfb06b75f2 Make these extern "C" so they play nice with all tools. 2010-04-08 07:49:38 +00:00
Miodrag Milanovic
d63d1711eb osd_get_emulator_directory removed (no credit) 2010-02-13 20:19:14 +00:00
Couriersud
5c2e28e845 No credit, please
- put code not actually required in MAME into "#ifdef MESS"
- Moved global definition of sdl_cwd from sdl_file.c back to sdl_main.c
2010-02-13 19:26:39 +00:00
Miodrag Milanovic
9758c13b82 - Removed not used OSD functions
- Placed new functions into sdlos subfiles since they need different implementation
(no whatsnew needed)
2010-02-13 17:20:25 +00:00
Miodrag Milanovic
0a6b13608d - Moved natural keyboard support from MESS to MAME
- Moved OSD file functions and clipboard access functions into OSD core
2010-02-12 15:40:11 +00:00
Aaron Giles
91a1b8d634 NOTE: This change requires two new osd functions: osd_malloc() and
osd_free(). They take the same parameters as malloc() and free().

Renamed mamecore.h -> emucore.h.

New C++-aware memory manager, implemented in emualloc.*. This is a
simple manager that allows you to add any type of object to a
resource pool. Most commonly, allocated objects are added, and so
a set of allocation macros is provided to allow you to manage
objects in a particular pool:

  pool_alloc(p, t) = allocate object of type 't' and add to pool 'p'
  pool_alloc_clear(p, t) = same as above, but clear the memory first
  pool_alloc_array(p, t, c) = allocate an array of 'c' objects of type
                              't' and add to pool 'p'
  pool_alloc_array_clear(p, t, c) = same, but with clearing
  pool_free(p, v) = free object 'v' and remove it from the pool

Note that pool_alloc[_clear] is roughly equivalent to "new t" and
pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also
note that pool_free works for single objects and arrays.

There is a single global_resource_pool defined which should be used
for any global allocations. It has equivalent macros to the pool_*
macros above that automatically target the global pool.

In addition, the memory module defines global new/delete overrides
that access file and line number parameters so that allocations can
be tracked. Currently this tracking is only done if MAME_DEBUG is
enabled. In debug builds, any unfreed memory will be printed at
the end of the session.

emualloc.h also has #defines to disable malloc/free/realloc/calloc.
Since emualloc.h is included by emucore.h, this means pretty much
all code within the emulator is forced to use the new allocators.
Although straight new/delete do work, their use is discouraged, as
any allocations made with them will not be tracked.

Changed the familar auto_alloc_* macros to map to the resource pool
model described above. The running_machine is now a class and contains
a resource pool which is automatically destructed upon deletion. If
you are a driver writer, all your allocations should be done with
auto_alloc_*.

Changed all drivers and files in the core using malloc/realloc or the 
old alloc_*_or_die macros to use (preferably) the auto_alloc_* macros 
instead, or the global_alloc_* macros if necessary.

Added simple C++ wrappers for astring and bitmap_t, as these need
proper constructors/destructors to be used for auto_alloc_astring and
auto_alloc_bitmap.

Removed references to the winalloc prefix file. Most of its 
functionality has moved into the core, save for the guard page 
allocations, which are now implemented in osd_alloc and osd_free.
2010-01-08 06:05:29 +00:00
Aaron Giles
bd24fb23c1 Results of running the latest srcclean. 2009-12-28 09:04:00 +00:00
Aaron Giles
2d22e450f2 Cleanups and version bump. 2009-10-12 08:45:25 +00:00
Aaron Giles
3851b425b7 Moved all the OSD/windows code over to straight BSD license.
Updated osdmini to work again and compile as an actual target
(doing nothing at the moment). Converted all of its code over
to straight BSD as well.
2009-10-12 05:56:47 +00:00
Aaron Giles
f60bbef070 Rename osd_profiling_ticks() to get_profile_ticks(). Moved implemention into
inline functions in eminline.h and the ei* functions. [couriersud, Aaron Giles]
2009-09-06 23:30:26 +00:00
Aaron Giles
f0ba9131eb osd_is_bad_read_ptr is no more. 2009-08-29 22:53:40 +00:00
Couriersud
8d92bff0b7 02180: Corrupt archives are read without problems
* corrupt files in archives now generate an error
* archive files ending in "/" will not be tested for crc - skip path entries
* add new flag FILE_OPEN_NO_PRELOAD to skip decompressing on open
  This is used in audit.c, which only tests whether files exist
* added error checking to all calls to load_file_zipped
2009-03-04 21:30:52 +00:00
Aaron Giles
ee9f88963c Copyright cleanup:
- removed years from copyright notices
 - removed redundant (c) from copyright notices
 - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
2008-01-06 00:47:40 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00