Commit Graph

29 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
rdb be282627a8 express: make PointerTo directly initializable from nullptr 2018-06-04 11:21:18 +02:00
Sam Edwards 5e82671084 general: Do away with TYPENAME macro 2018-06-03 16:36:34 -06: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 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 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 9513046e59 Various substantial changes to Interrogate:
* Allow arbitrary selection of optional keyword arguments in some cases
* Reduce code bloat of generated bindings
* Work around awkward resolution of set_shader_input overloads
* Document the code a bit better
* Make coercion a bit cleaner for reference counted types
* A few optimization tweaks
* Use generic errors in NDEBUG build to reduce size of string pool
2015-02-15 13:48:13 +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
rdb 8c0b0990a8 Dramatically improve performance when sorting vectors of PointerTo objects 2014-12-30 00:06:15 +01:00
David Rose fb9c56432a we are now using the modified BSD license 2008-05-28 18:37:20 +00:00
David Rose d87cae471d more better pstats mem tracking 2007-05-10 14:40:52 +00:00
David Rose c1091e7b4a build on MSC 2005 2007-02-08 20:14:52 +00:00
David Rose 0bd34f9f4b runtime improvements 2005-05-10 22:43:44 +00:00
David Rose 475196cbef robustify WeakPointerTo, publish ConstPointerTo 2005-03-11 19:29:57 +00:00
David Rose 557060cb1d weak pointers, and FadeLODNode fixes for instances/multiple cameras 2004-09-30 21:29:25 +00:00
David Rose 843c0331ae update license, change remaining local #includes to use quotation marks 2004-02-13 19:27:33 +00:00
Dave Schuyler 4e83b2ae04 *** empty log message *** 2003-07-11 23:04:12 +00:00
David Rose 411a263fe8 build for gcc3.2 2003-01-17 16:42:36 +00:00
David Rose 2f4e207edb Update copyright header 2001-05-25 21:27:38 +00:00
David Rose fcb24f02ef remove tab characters 2001-05-25 15:56:49 +00:00
David Rose 0824e8031c *** empty log message *** 2001-05-12 15:57:34 +00:00
David Rose 7d38626876 *** empty log message *** 2000-11-17 04:49:21 +00:00
David Rose 2fd714e52f Initial revision 2000-10-04 01:14:41 +00:00