Peter Nelson
2ecc3c90f7
Change: Improve performance of finding free pool slots. ( #12055 )
...
Add a bitmap of used pool slots which allows finding a free pool slot without having to check if each index is already used or not.
Loosely based on a JGRPP patch.
2024-02-17 18:29:21 +00:00
Rubidium
e3f49ee7a0
Codechange: coding style fixes
2024-01-04 16:23:54 +01:00
Peter Nelson
49dae08a3b
Codechange: Add missing override specifiers.
2023-09-25 21:27:45 +01:00
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
2023-09-19 22:49:59 +02:00
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Rubidium
3323402aaa
Codechange: rename smallvec_type to container_func and use only when needed
2023-05-20 16:53:10 +02:00
Loïc Guilloux
8a083cd7f8
Fix 68f2213: Don't use GetPoolSize() for end of pool iterator ( #9461 )
2021-08-10 19:03:15 +02:00
Patric Stout
28e90769f7
Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
...
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
2021-06-03 17:30:00 +02:00
Patric Stout
4d501655ad
Fix: building on Raspberry Pi failed because of const vs constexpr ( #8924 )
2021-04-01 19:39:55 +02:00
Charles Pigott
860c270c73
Codechange: Replace assert_compile macro with static_assert
2020-12-27 10:55:42 +00:00
Jonathan G Rennison
150dfba95b
Codechange: Remove std::function from Pool iteration wrapper
...
Add a separate template wrapper for filtered iteration
2020-01-07 09:00:45 +00:00
glx
e3c75a30ba
Fix: unused variable warnings
2019-12-21 20:13:03 +01:00
glx
ae532008ff
Cleanup: remove FOR_ALL_ITEMS
2019-12-21 20:13:03 +01:00
glx
68f22134cb
Add: Allow iteration of pools in range-based for loops
2019-12-21 20:13:03 +01:00
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
2019-11-10 17:59:20 +00:00
JMcKiern
04f659e768
Fix: Some typos found using codespell
2019-09-29 21:27:32 +01:00
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
2019-04-10 23:22:20 +02:00
Henry Wilson
c01a2e2a81
Codechange: Removed SmallVector completely
2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
2019-03-26 20:15:57 +00:00
frosch
858e80f3dd
(svn r26333) -Fix: Compilation without static_assert.
2014-02-11 20:34:48 +00:00
fonsinchen
e37656f2e5
(svn r26331) -Fix: some inconsistencies regarding link graph (job) IDs.
2014-02-10 20:13:07 +00:00
fonsinchen
e21ae34878
(svn r25887) -Fix: Ignore NULL pointers in delete operator of PoolItem.
2013-10-20 13:35:35 +00:00
rubidium
13855f0a09
(svn r25705) -Fix: a number of typos (inspired by 90c920601c84975acb694f3673e2beb08b013753)
2013-08-09 18:43:44 +00:00
frosch
18ae9c78bc
(svn r25402) -Fix-ish: Prevent copying of BasePool and WindowDesc, since they register in static vectors.
2013-06-15 15:06:22 +00:00
planetmaker
c24374f99c
(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
2013-01-08 22:46:42 +00:00
truebrain
1c9bec1999
(svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC)
2011-12-20 17:57:56 +00:00
planetmaker
ac0700c564
(svn r22136) -Fix (r22112): Silence compiler warning about non-virtual destructor
2011-02-24 06:57:55 +00:00
smatz
756cc6cf65
(svn r22116) -Codechange: use PoolBase::Clean() at more places
2011-02-19 23:05:47 +00:00
smatz
642fb19d4f
(svn r22115) -Fix (r22114): some comments and code ordering were wrong
2011-02-19 18:55:10 +00:00
smatz
5fd13843f7
(svn r22112) -Codechange: register all pools in a pool vector
2011-02-19 18:23:45 +00:00
smatz
fbfb0ffbf2
(svn r22041) -Codechange: add a check that we called PoolItem::CanAllocateItem() before actually allocating it
2011-02-09 18:55:51 +00:00
rubidium
eb299736c1
(svn r21886) -Codechange: move documentation towards the code to make it more likely to be updated [n].
2011-01-22 09:53:15 +00:00
rubidium
485b5a9c2f
(svn r18045) -Fix: GCC 4.5@HEAD not compiling OpenTTD anymore because of a "non-placement deallocation function [is] selected for placement delete", or in other words delete(void *, size_t) is 'magic'.
...
We implemented these delete(void *, size_t) operator functions because MSVC warned that "no matching operator delete found; memory will not be freed if initialization throws an exception" for new(size_t, size_t).
This disables MSVC warning about this because we do not use exceptions in the (constructors that use the) overridden allocation functions, as such they will never be called; delete(void *) remains necessary though.
2009-11-11 21:15:58 +00:00
rubidium
1528b64a68
(svn r17839) -Codechange: implement the concept of 'caching' pool items to pools, that is instead of 'free' push the unused items in a linked list and use them on 'malloc'. Also add the concept of zeroing, or actually not zeroing, on new for pool items.
2009-10-21 19:38:50 +00:00
rubidium
0ebe525e5b
(svn r17838) -Document: the Pool struct's template parameters
2009-10-21 15:40:50 +00:00
rubidium
7fbc33dae1
(svn r17248) -Fix: add GPL license notice where appropriate
2009-08-21 20:21:05 +00:00
smatz
c861d9b64b
(svn r16745) -Fix [FS#3011]: invalidate JoinStation window after removing item from the pool
2009-07-05 13:20:05 +00:00
smatz
56a7b70591
(svn r16380) -Codechange: rename pool.hpp to pool_type.hpp
2009-05-22 15:39:22 +00:00