summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/pool.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-621/+0
|
* Cleanups and version bumpmame0163 Miodrag Milanovic2015-06-241-3/+3
|
* Licenses for Raphael Nabet (nw) Miodrag Milanovic2015-06-071-0/+8
|
* Bulk convert files that already had standard BSD license in my name Aaron Giles2013-10-161-31/+2
| | | | to new license tagged form.
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-23/+23
|
* Final round of struct/union/enum normalization. Aaron Giles2012-09-161-2/+2
|
* First pass at modernizing struct definitions. Aaron Giles2012-09-151-6/+3
|
* Fix the memory leaks with the strconv.c function by Scott Stone2010-04-231-1/+1
| | | using osd_malloc() instead. Fixed other memory leaks as well. [Oliver Stoneberg]
* pool.c calls renamed so they can me used by MAMEUI and MESS (no whatsnew needed) Miodrag Milanovic2010-01-191-20/+19
|
* lib/util now includes stdlib.h where needed Couriersud2010-01-171-0/+2
|
* NOTE: This change requires two new osd functions: osd_malloc() and Aaron Giles2010-01-081-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Results of running the latest srcclean. Aaron Giles2009-12-281-2/+2
|
* Some misc cleanups: Aaron Giles2009-12-151-2/+2
| | | | | | | | | | | | | | | | - added warning messages for auto_malloc, timer, and save state allocations done after init time. These should be fixed when detected, as I would eventually like to disallow them entirely. - changed state registration functions to pass through the caller's file and line number to facilitate fixing the above warnings - converted Taito F3 sound to a separate machine driver which is imported into games that use it - converted the balsente driver to driver_data structure - converted harddriv timers into devices - fixed crash in cps2 games due to not configuring the qsound bank - cleaned up initialization in taito_l to allocate at init time instead of reset time
* Cleanups and version bump.mame0134u3 Aaron Giles2009-10-121-13/+13
|
* Moved all files in src/lib/util over to straight BSD and common Aaron Giles2009-10-101-2/+30
| | | | copyright, with permission of all significant contributors.
* Modified the makefile to support experimental optional C++ Aaron Giles2009-02-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compilation: - new option CPP_COMPILE to trigger this (off by default) - split CFLAGS into common, C-only, and C++-only flags - when enabled, CPP_COMPILE causes 'pp' to be appended to the target name NOTE THAT THE SYSTEM CANNOT ACTUALLY BE COMPILED THIS WAY YET. IT IS JUST AN EXPERIMENT. Modified lib.mak to always build zlib/expat as C regardless of CPP_COMPILE. Modified windows.mak to fix warnings with MAXOPT=1, and to leverage the new CFLAGs definitions. Modified vconv.c to do appropriate conversions for new C++ options. Updated sources so that libutil, libocore (Windows), and libosd (Windows) can be cleanly compiled as C or C++. This was mostly adding some casts against void *. Fixed a few more general obvious problems at random locations in the source: - device->class is now device->devclass - TYPES_COMPATIBLE uses typeid() when compiled for C++ - some functions with reserved names ('xor' in particular) were renamed - nested enums and structs were pulled out into separate definitions (under C++ these would need to be scoped to be referenced) - TOKEN_VALUE cannot use .field=x initialization in C++ :(
* Cleanups/version bump/added missing drivers.mame0128u5 Aaron Giles2008-12-061-5/+5
|
* Pool items are now tracked globally, and freed in reverse order Aaron Giles2008-11-261-43/+50
| | | | of allocation. This enables proper nesting.
* Need to actually set the pool fail callback when allocating a pool. Aaron Giles2008-01-191-0/+3
|
* Copyright cleanup: Aaron Giles2008-01-061-1/+1
| | | | | | - removed years from copyright notices - removed redundant (c) from copyright notices - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
* (From Oliver Stoneberg) Aaron Giles2008-01-031-2/+2
| | | | | | | This is an updated version of my earlier ATTR_PRINTF patch. It was reviewed by Atari Ace to use ATTR_PRINTF properly and fixes even more format errors. I also reviewed the whole source again and it is now used in all possible places.
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+614