Commit Graph

112 Commits

Author SHA1 Message Date
ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
8c068aab07 Removes possibility to link lowlevel library dynamically.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4470
This was SVN commit r26281.
2022-01-31 06:53:30 +00:00
5656c4117d Adds std namespace to shared_ptr usages in lib.
This was SVN commit r25529.
2021-05-22 19:32:38 +00:00
9ed3b88d25 Guarantees no memset for allocation of DynamicArena::Block
Differential Revision: https://code.wildfiregames.com/D3609
This was SVN commit r24968.
2021-03-01 20:35:30 +00:00
b2310ad70a Makes DynamicArena more cache-friendly and removes useless member.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3560
This was SVN commit r24899.
2021-02-13 17:33:05 +00:00
8ae3c09dc0 Fix renderer crash in GCC 7.5.
The 'arena' allocator does not take memory alignment into account, which
can result in crashes at -O3 with gcc 7.5 (presumably because of SSE
instructions).

This accounts for alignment issues, fixing the issue.
Also do various cleanup in lib/allocators.

Reported by: Bellaz89, Freagarach
Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3181
This was SVN commit r24517.
2021-01-06 14:56:17 +00:00
369c2e8801 Further header & precompiled cleanup, fix no-PCH builds.
GUIObjectBase is made a IGUIObject* to avoid including those headers
un-necessarily. Subsequent diffs ought to clean up the various of
pointers for that with a similar type with reference semantics.

Also:
- Add standard C and C++ headers (mostly cstring for memcpy, string and
vector) where needed.
- Swap out some includes for forward declarations
- Clean up un-necessary boost includes in precompiled and other headers.
- Clean up precompiled headers, including fewer things.
- Move ACPI to the windows-specific folder as it's included there only
and mostly specific to that platform.

Thanks Stan for the testing.

Differential Revision: https://code.wildfiregames.com/D3129
This was SVN commit r24352.
2020-12-09 14:39:14 +00:00
2288de4aa6 Remove UniqueRange custom code in favour of unique_ptr
UniqueRange was a unique_ptr replacement with a few tweaks (such as a
compulsory custom deleter). Its features are not really used, it
contains outdated atomic calls, and it blocks D1511, thus it is removed.

Refs #5165

Differential Revision: https://code.wildfiregames.com/D613
This was SVN commit r24234.
2020-11-22 13:43:19 +00:00
5d2c20beb0 Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency.
Replace boost::hash_combine with a lib/hash.h hash_combine performing
the same statement.
Replace inconspicuous global boost hash_value specializations with
std::hash specializations.
No performance difference was observed in three simple MeshManager
measurements.

Remove unused TAG_MASK and h_tag in h_mgr.cpp following 0748c5a75e.
Replace typedef with using keyword and sort header includes.

Differential Revision: https://code.wildfiregames.com/D2441
Tested on: clang  9.0.0, gcc 9.2.0, Jenkins/vs2015, Jenkins/gcc6

This was SVN commit r23191.
2019-11-25 14:30:25 +00:00
cc67d54aeb Fix compiler warnings on VS 2015, refs #3439, refs #5069.
Patch By: Stan
Reviewed By: Itms, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1262
This was SVN commit r21480.
2018-03-10 09:58:53 +00:00
43137fef3f Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c).
Differential Revision: https://code.wildfiregames.com/D716
Refs 09e974e1cb
Reviewed By: bb
Change in agreement with leper.

This was SVN commit r19899.
2017-07-10 14:26:24 +00:00
51f7502bb1 Don't move temporaries, so possibly allowing for copy elision.
Pointed out by clang's -Wpessimizing-move.

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D421
This was SVN commit r19559.
2017-05-11 23:24:54 +00:00
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
0843100d11 Remove partial emulation of some C++11 features for older compilers.
This was SVN commit r16226.
2015-01-24 20:37:18 +00:00
85e2e72eb7 Fix TestHeaderless failure on GCC 4.9.
Once 'delete' is called on an object, that object no longer exists, and
accessing its member variables is undefined behaviour. GCC 4.9's
optimiser recognises this, and eliminates any writes to member variables
inside the destructor, since it knows they cannot legally be read later.

BoundaryTagManager relied on ~FreedBlock resetting its memory to 0, so
this optimisation broke it. Replace the placement new/delete with plain
non-magic Setup/Reset functions, to avoid the optimisation.

Fixes #2481.

This was SVN commit r15334.
2014-06-11 19:50:38 +00:00
b1c081e36d Set svn:eol-style=native, fix some inconsistent line endings
This was SVN commit r14299.
2013-12-06 00:42:50 +00:00
e24ce51029 Adds DynamicArena allocator that grows by fixed chunk size, fixes #2142.
Changes fixed size arenas to new dynamic arenas with reasonable chunk
sizes (may require tuning), refs #1842

This was SVN commit r13916.
2013-09-30 01:22:44 +00:00
c2583e42da Reduce memory allocations in the renderer
Use an arena allocator in ShaderModelRenderer::Render, to reduce
the allocation cost in STL containers.

Avoid unnecessary copying of std::vectors.

This was SVN commit r13911.
2013-09-29 14:48:11 +00:00
f4625e69af Partial Android compatibility.
Remove unnecessary VM allocation (which seemingly causes problems on
Android due to mmap during static initialization).
Allow building without NVTT.

This was SVN commit r11074.
2012-02-15 13:58:58 +00:00
78ba79209d more minor fixes. rename uname.machine to x64 (less confusing than amd64)
This was SVN commit r10827.
2011-12-29 09:47:42 +00:00
1e210165f2 Fix some MSVC static analysis warnings
This was SVN commit r10825.
2011-12-29 02:06:09 +00:00
3537ae31d5 sync with work:
x86_x64: update MSR definitions to include model 2F (westmere ex);
update bus clock computation for sandy bridge; remove unused
cpu_Serialize; use namespace, add model names
mahaf: cope with stricter security for services/drivers
ApicId -> GetApicId, move to apic module
aken: add batch file to install driver (optional)

This was SVN commit r10815.
2011-12-27 14:12:31 +00:00
587487811b Fixes typo in pool allocator stats, based on patch from Echelon9. Fixes #1061.
This was SVN commit r10799.
2011-12-23 03:54:36 +00:00
f4e46d166d sync with work; minor fixes (wsdl must report gfx memory in KB to match sdl)
This was SVN commit r10678.
2011-12-06 09:17:39 +00:00
fbff0aa98d Fix printf argument types
This was SVN commit r10529.
2011-11-13 18:31:06 +00:00
8af8326563 replace old pool_allocator/RawPoolAllocator with ProxyAllocator that draws upon the new-style Arena (more efficient, avoids slow VirtualAlloc)
This was SVN commit r10410.
2011-10-16 10:37:21 +00:00
6c102ea712 add instrumentation to diagnose failed VM commit
This was SVN commit r10405.
2011-10-15 22:03:42 +00:00
0fa54bc56a fix compile error due to GCC restriction.
thanks to daniel.santos for reporting and alex for creating the
ticket/notifying me.
fixes #992

[heh, the amount of comments are proportional to the trouble caused by
this code :S ran into VC++ compile errors when __declspec came after
void* return type *sigh*]

This was SVN commit r10385.
2011-10-10 20:08:04 +00:00
8ac994e4e6 sync with work: add and use NOTHROW; export file_system functions; throw Status from File ctor; add WARN_THROW equivalents of WARN_RETURN
This was SVN commit r10384.
2011-10-10 10:04:36 +00:00
ed959b8da7 minor fixes: add missing arena.cpp; add required NONCOPYABLE annotation; fix UNUSED2 to work in the case of references.
This was SVN commit r10059.
2011-08-22 08:54:56 +00:00
509f4387d7 Fix build
This was SVN commit r10052.
2011-08-21 13:10:44 +00:00
881d3cebf4 lay groundwork for more efficient and flexible allocators. add new sysdep/vm that provides access to additional features on Windows (large pages, autocommit). add Pool/Arena allocators that avoid overhead and support arbitrary storage (not just the expensive virtual memory allocator in DynArray)
This was SVN commit r10051.
2011-08-21 11:00:09 +00:00
3eb1ed0139 (actually remove)
This was SVN commit r10050.
2011-08-21 10:31:23 +00:00
c26a369762 remove Bucket allocator (superseded by upcoming Arena/Pool with expandable Storage policies)
This was SVN commit r10049.
2011-08-21 10:30:35 +00:00
9f97610cb2 refactor: remove "wrapping" and "read" functionality for DynArray (in preparation for replacing it with template policies for more flexible Pool etc.)
This was SVN commit r10024.
2011-08-17 08:38:53 +00:00
0748c5a75e cleanup and simplification of the really old h_mgr code.
replace array-of-pages data structure with demand-committed VM => allows
simple allocation of new resources without having to search for the
first free index. I suspect the cause of multiple reported bugs (refs
#860, #899, #915) was a race. Most issues are fixed, but the pool's
freelist also needs to be made thread-safe and lock-free. this has
performance and 64-bit portability implications, so I'll leave it for
later (Pool is due for some serious refactoring anyway).

please post a comment if this or similar issues persist.

This was SVN commit r9961.
2011-08-04 17:11:16 +00:00
6304797cbd pool - safely handle zero-sized allocations (fixes #909)
snd_mgr - remove no longer needed hacks for native OpenAL
implementations
test_wdbg_sym.h - belated commit of warning fix

This was SVN commit r9944.
2011-07-31 09:42:57 +00:00
0d23e3f333 post-alpha sync with work.
debug stack trace fixes, remove more asm, change CONTINUE/OK scheme to
OK/ALL_COMPLETE, fix tests

This was SVN commit r9871.
2011-07-18 09:21:56 +00:00
f1a1f023df reinstate aligned_allocator.h (required at work)
further fixes to preserve the last error while building error messages
somewhat more accurate NUMA factor computation

This was SVN commit r9545.
2011-05-23 14:10:45 +00:00
46e5db4dc4 fix build with ICC
This was SVN commit r9475.
2011-05-07 15:47:20 +00:00
f608b44d1d fix self-test and map load on Windows (avoid mixing dir separators).
add more specific error codes (used at work)

This was SVN commit r9462.
2011-05-06 18:45:30 +00:00
7523894760 ENSURE(0) -> DEBUG_WARN_ERR(ERR::LOGIC) (a bit smaller, and more descriptive)
This was SVN commit r9423.
2011-05-04 12:10:17 +00:00
cccd6849a7 cleanup (requires update-workspaces)
lib_errors.cpp: replace with status.cpp, adapt to needs at work
wutil: fix runtime warning reported via feedback box
config: merge CONFIG_PARANOIA and !CONFIG_FINAL into
CONFIG_ENABLE_CHECKS
add openmp, pointer_typedefs.h

This was SVN commit r9410.
2011-05-03 12:38:42 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
6c915291cc cleanup (requires update-workspaces):
major refactor of wfilesystem - remove gotos and workaround for FAT file
times
replace more round_up of constants with Align<>
remove old unused allocators (STL aligned, matrix, some shared_ptr)
move allocator utils into separate headers.
remove lockfree, wterminal
avoid testing __cplusplus

This was SVN commit r9361.
2011-04-30 12:34:28 +00:00
335e7db6be Fix build more
This was SVN commit r9353.
2011-04-29 23:30:29 +00:00
34ba390a0d build fix for pre-C++0x compilers.
archive_zip, stream: work around possibly missing support for
std/tr1::bind in GCC by defining a functor manually
also renamed RVREF to RVALUE_REF and ensured RVALUE can convert from
both lvalue and rvalue.
io: avoid dodgy constants and possible overflow by using blockSize=0 to
indicate "don't split"

This was SVN commit r9352.
2011-04-29 22:55:35 +00:00