Commit Graph

62 Commits

Author SHA1 Message Date
Jordi Vilalta Prat
b1999a2a16 Fixed indentation and removed whitespaces at the end of line
svn-id: r35481
2008-12-22 11:22:15 +00:00
Max Horn
95474b048a COMMON: Added a new ObjectPool class, with matching operator new/delete overloads
svn-id: r34785
2008-10-12 22:05:26 +00:00
Max Horn
31ce5eb496 Revised HashMap implementation
svn-id: r34273
2008-09-02 11:34:12 +00:00
Max Horn
a79e9385a1 Unified member names in container/storage classes Array, HashMap and String: _storage, _size, _capacity
svn-id: r34052
2008-08-20 11:07:16 +00:00
Max Horn
47429f2197 Extended HashMap debug output
svn-id: r34051
2008-08-20 10:18:59 +00:00
Lars Persson
476e5bbb10 List the correct engines in about,
updated actions with Lure (from WinCE). 
Increased min heap size to 5MB

svn-id: r33618
2008-08-04 18:14:17 +00:00
Lars Persson
c296869108 Disable hashmemory pool for Symbian OS
svn-id: r33212
2008-07-22 19:09:10 +00:00
Willem Jan Palenstijn
90bf3de2d6 Decrement _nele when erasing an element from hashmap, and add a test-case for this bug.
svn-id: r32343
2008-05-28 18:32:05 +00:00
Johannes Schickel
db04dd427d Formatting.
svn-id: r31852
2008-05-03 23:02:05 +00:00
Johannes Schickel
8436943bfd Committed patch #1929274 "HashMap: Iterator rework".
svn-id: r31356
2008-04-02 02:01:31 +00:00
Johannes Schickel
39995e29ad Added fixme regarding header 'new'.
svn-id: r31339
2008-03-30 18:59:24 +00:00
Bertrand Augereau
5f3529ce78 Whitespacing fixes
svn-id: r31330
2008-03-30 14:07:34 +00:00
Bertrand Augereau
a84d1ea78b The hashmap uses the memorypool for allocating/deallocating its Nodes
(It is faster and it saves approximately 70kB the DS or other small devices will appreciate having)

svn-id: r31321
2008-03-30 06:02:34 +00:00
Johannes Schickel
ff5743ba8f Cleanup.
svn-id: r31316
2008-03-30 02:43:18 +00:00
Johannes Schickel
dcc385f3de Fixed hashmap code. (please make a better check next time when changing code in common/, this was a really bad one :-/)
svn-id: r31314
2008-03-30 02:36:23 +00:00
Johannes Schickel
6a5ae22368 Formatting.
svn-id: r31308
2008-03-30 00:54:46 +00:00
Bertrand Augereau
7b295995dc Centralized the way the hashmaps allocate and free nodes (in order to instrument and maybe use a pool allocator later)
svn-id: r31305
2008-03-29 23:04:10 +00:00
Johannes Schickel
56c5d86431 Fix bug preventing compilation in iterator code.
svn-id: r30818
2008-02-07 21:28:51 +00:00
Eugene Sandulenko
0ae9fe7467 Second part of patch #1880781: "BeOS port for scummvm"
svn-id: r30720
2008-01-31 21:19:09 +00:00
Max Horn
0728aa0d7f Forward declare HashMap::ConstIterator (this might fix compile errors with some old GCC versions)
svn-id: r30670
2008-01-28 08:40:30 +00:00
Jordi Vilalta Prat
66e9d4f5e8 Removed trailing spaces.
svn-id: r30664
2008-01-27 19:47:41 +00:00
Max Horn
465356ed08 assert if hashmap iterator is out of bounds (e.g. happens when derefing end()
svn-id: r30623
2008-01-23 17:19:58 +00:00
Max Horn
79e1579cb3 Fix warnings HashMap causes on some compilers (notably, GCC 3.x used for various cross compilers)
svn-id: r30472
2008-01-13 14:44:29 +00:00
Max Horn
1eeaaab15d Fix hashmap.h properly (this is not a bug in GCC 4.0 etc., rather it's a bug in newer GCC versions that they *accepted* the old code...)
svn-id: r30022
2007-12-28 00:08:29 +00:00
Kostas Nakos
1312d4b3fd same bug on arm-wince-gcc 4.1.0
svn-id: r30014
2007-12-27 16:40:58 +00:00
Johannes Schickel
e36f79fcdf Fix for bug #1858824 "AMIGAOS4: Build Process breaks due to regression".
svn-id: r30013
2007-12-27 16:01:59 +00:00
Max Horn
a7397ecfcc Patch #1837119 (COMMON: Common::HashMap iterator rework) with workaroud for Mac OS X compiler bug
svn-id: r30004
2007-12-26 21:40:32 +00:00
Nicola Mettifogo
258901bab9 Merged common/stdafx.h into common/scummsys.h. All referencing files have been updated.
svn-id: r28966
2007-09-19 08:40:12 +00:00
Max Horn
218e132e37 Updated legal headers in source files, based on what Pidgin (the IM client formerly knowns as Gaim) does; added new (incomplete) COPYRIGHT file; updated copyright dates in a few spots
svn-id: r27024
2007-05-30 21:56:52 +00:00
Max Horn
30e975f9db Protect Array<> and HashMap<> instances against self assignments
svn-id: r26115
2007-03-12 22:34:29 +00:00
Max Horn
6d9cb5498f Avoid double frees in HashMap::erase
svn-id: r26040
2007-03-09 16:19:50 +00:00
Max Horn
43cd428355 Some HashMap cleanup:
* Removed the odd return value of method erase()
* Stopped erase() from leaking (oops!)
* Added a (paranoia) consistency check to assign()

svn-id: r25967
2007-03-04 09:58:04 +00:00
Max Horn
b25c7933a5 Paranoia: a hashmap node must never ever change its key after its creation
svn-id: r25965
2007-03-04 09:27:28 +00:00
Max Horn
8b7fdca4ac Return a default value in the const-variant of HashMap::getVal, instead of asserting out -- this way, we get less unexpected asserts, and both getVal variants behave comparably diff. The drawback is that now all HashMap instances carry one extra Value object around with them.
svn-id: r25245
2007-01-28 13:30:26 +00:00
Max Horn
0c148fc44e Added non-const variant of HashMap::getVal
svn-id: r25136
2007-01-21 00:11:45 +00:00
Max Horn
12476efb58 Added some new HashMap methods: lookupAndCreateIfMissing (internal only), setVal and getVal (which actually is just the old queryVal renamed for consistency)
svn-id: r25135
2007-01-21 00:06:50 +00:00
Max Horn
d1b97e6786 Added copy constructor and assignment operator to class HashMap
svn-id: r25125
2007-01-19 21:55:45 +00:00
Chris Apers
efe466040a Still doesn't work with PalmOS compiler
svn-id: r25079
2007-01-14 11:06:34 +00:00
Max Horn
5c8de9b3b0 Replaced #ifdef hack in the HashMap code by a much nicer and cleaner 'friend class' statement (a similar change might be possible in class List)
svn-id: r24791
2006-11-26 22:39:34 +00:00
Max Horn
20d46ab409 typo
svn-id: r24093
2006-10-03 11:33:06 +00:00
Max Horn
51010bd038 Remove BaseNodeType (it is not used anymore, we can readd it, should we ever have need for it again)
svn-id: r24079
2006-10-02 20:13:48 +00:00
Max Horn
53f73eac85 Added explicit string equals/hash functors to a new header common/hash-str.h; removed Hash functor specialization for String and char pointers; changed all code using hashmaps with string keys to explicitly specify whether they honor or ignore case
svn-id: r23634
2006-07-30 12:21:54 +00:00
Max Horn
b3a66e817f Rename BaseNodeFunc to BaseNodeType
svn-id: r23627
2006-07-30 10:48:44 +00:00
Max Horn
c59e7ece0a Part of the FreeMiNT patch
svn-id: r23566
2006-07-22 17:00:36 +00:00
Max Horn
5d1e4d7f09 Removed unnecessary typedef
svn-id: r22875
2006-06-03 13:56:50 +00:00
Max Horn
0e174a8adc Really remove HashMap::find(char *)
svn-id: r22874
2006-06-03 13:39:39 +00:00
Max Horn
5a1eaabceb Replaced the bogus find(const String &key) method with the proper find(const Key &key) one. Also removed the bogus find(const char *key) (which not only doesn't work correctly for non-string keys, but also usually will be *less* efficient)
svn-id: r22871
2006-06-03 13:32:53 +00:00
Eugene Sandulenko
061905c524 Plug memory leak
svn-id: r22842
2006-06-02 17:57:45 +00:00
Eugene Sandulenko
180f6c87ad Remove slipped in debug output.
svn-id: r22840
2006-06-02 16:07:40 +00:00
Eugene Sandulenko
3348c32de0 Added possibility to use (char *) as ashMap keys. For some reason it does not
work as expected. When I try to switch _aliasmap in eval.h to it, I get 
crash in String constructor on dereferencing.

svn-id: r22838
2006-06-02 15:41:48 +00:00