Commit Graph

21 Commits

Author SHA1 Message Date
rdb ad3ab3ad21 Define stable ordering for WeakPointerTo for use as map/set key
Currently, the WeakPointerTo comparison operators compare the raw pointers, but this is not useful as it may cause a false equality if one weak pointer in the comparison is expired and points to memory that has since been reused.

Instead, we can define a comparison based on the control block pointer, which exists since the new weak pointer implementation in 0bb81a43c9.  This is implemented in the owner_before method, matching C++11 std::weak_ptr semantics.

I would now recommend deprecating most comparison operators of WeakPointerTo or redefining them to make more sense, ie. comparing equal if they (once) referred to the same object and not if they simply point to the same memory address.  This has not yet been done, though code that uses the comparison operators has been fixed in this commit.

Overloads of std::owner_less have been provided for creating a map or set with Weak(Const)PointerTo keys.
2018-07-30 17:27:09 +02:00
rdb 23128e4695 express: support casting between compatible PointerTo types
This makes it possible to implicitly convert a PT of a derived type to a (C)PT of a base type, without needing to first convert it to a regular pointer.  This also applies to moves, which are now more efficient due to the lack of need for ref/unref pair even if the pointer type is not exactly the same.
2018-07-08 21:33:49 +02:00
Sam Edwards 7790f8429d general: Fully qualify header references into the std namespace
Closes #341
2018-06-07 10:35:12 +02:00
rdb 9fad3dba60 general: remove macros for compatibility with non-C++11 compilers
Now that we require MSVC 2015, we no longer need all this nonsense, so we can write cleaner code.
2018-05-23 23:33:05 +02:00
rdb 925ce854d0 general: make DO_MEMORY_USAGE setting not change ABI compatibility 2017-07-10 19:50:09 +02:00
rdb f57a3f9cde Hack to remove build warning on MSVC 2010
Fixes LP #1700329
2017-07-03 11:13:02 +02:00
rdb 2e8d09a99c Workaround for compiler bug when producing debug build
(with thanks to consultit)
2017-06-09 19:48:44 +02:00
rdb 6f8b379bda Big patch full of performance improvements
This particularly benefits applications with a lot of nodes.
2017-04-03 01:41:23 +02:00
rdb a15d84dbeb Fix compile errors and warnings in MSVC 2010 / GCC 4.6 2017-01-12 15:18:48 +01:00
rdb e60d1e292e Make better use of C++ rules for implicit generation; allow PointerTo and some mutex impls to be static initialised 2017-01-12 12:34:15 +01:00
rdb 8d05ef3022 Assorted fixes 2016-06-03 22:23:42 +02:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb a453ec1925 Overhaul text generation; now 75x as fast as before. 2015-11-13 01:44:03 +01:00
rdb af15797a25 Many, many performance optimizations and enhancements 2015-01-07 19:30:01 +01:00
rdb e8905b840c Use C++11 move semantics to dramatically improve PointerTo performance 2015-01-02 15:25:58 +01:00
David Rose fb9c56432a we are now using the modified BSD license 2008-05-28 18:37:20 +00:00
David Rose 0bd34f9f4b runtime improvements 2005-05-10 22:43:44 +00:00
David Rose 977f692331 NodeCachedReferenceCount 2005-05-09 13:59:15 +00:00
David Rose 475196cbef robustify WeakPointerTo, publish ConstPointerTo 2005-03-11 19:29:57 +00:00
David Rose dbb24d9cc9 phash_map, etc. 2004-10-02 05:07:16 +00:00
David Rose 557060cb1d weak pointers, and FadeLODNode fixes for instances/multiple cameras 2004-09-30 21:29:25 +00:00