Commit Graph

3094 Commits

Author SHA1 Message Date
rdb c356285212 dtoolbase: Compilation fix for broken STLs without atomic::value_type 2022-02-24 11:41:54 +01:00
rdb c3ce8164bc dtoolbase: Add atomic wait and notify operations from C++20
Adds patomic_signed_lock_free, patomic_unsigned_lock_free, and patomic_flag with wait/notify methods modelled after C++20.  Implemented using futexes, falling back to a mutex+condition variable hash table if not supported.  (Currently the hash table has a fixed size of 64, which we could increase if necessary, but we really shouldn't even have a fraction of that number of simultaneously sleeping threads...)

Other atomic types are unaffected at the moment, in part because futexes are really restricted to 32-bit ints on Linux anyway
2022-02-23 23:20:26 +01:00
Paul m. p. P 833ad89eba py_panda: Fix compilation issue with Python 3.11 2022-02-07 19:33:19 +01:00
rdb 07545bc9e3 dtoolbase: Use mimalloc on Windows, disable USE_DELETED_CHAIN
Windows' malloc has awful performance.  mimalloc is orders of magnitude faster, even faster than DeletedBufferChain.  Therefore, only enable USE_DELETED_CHAIN on Windows when building without mimalloc.

On Linux, mimalloc doesn't appear to be measurably faster than glibc's own allocator.  Both are marginally than DeletedBufferChain, though, and substantially faster in the multi-threaded case, so USE_DELETED_CHAIN is disabled there in all cases.
2022-02-04 23:50:57 +01:00
rdb 39d69f13de dtoolbase: Change DeletedBufferChain to use new C++11-style atomics 2022-02-04 20:52:31 +01:00
rdb 87f5aea80e gtk-stats: Update to GTK version 3, since version 2 is EOL 2022-02-01 17:17:56 +01:00
rdb 8034cb5a92 dtoolbase: Introduce patomic<> as replacement for AtomicAdjust
This typedefs to std::atomic<> when building with true threading, and uses a dummy implementation without.

This lets us use the full range of atomic operations offered by C++11, including explicit specification of memory fences.  Using barriers lets the compiler generate more optimal code since currently we are using the quite strict sequential-consistent memory ordering for all operations.  ReferenceCount has been changed to use the correct barriers (I hope).  This may especially make a difference on weak ordering systems such as ARM.

Over time we should gradually replace the use of AtomicAdjust with the new patomic file.
2022-01-30 01:53:36 +01:00
rdb a0c2f2ff3b prc: Add pickle support to ConfigVariable
The current value is not pickled.  I might change my mind on this, but my thinking is that ConfigVariable doesn't really contain a value, it's just an accessor for a value from the config page, so the current state of the variables should be pickled with the config pages.
2021-12-19 14:36:17 +01:00
rdb a354b774b3 interrogate: Add __reduce_ex__ to methods that shouldn't be renamed 2021-12-14 11:31:37 +01:00
rdb e4013226e1 general: Remove vestigial typedef.h file 2021-12-12 18:37:49 +01:00
rdb eaf8cb79d5 Add pickle support to a variety of classes 2021-12-12 18:35:44 +01:00
rdb 8b49b0f2b2 parser-inc: Add stub for <android/log.h> 2021-12-09 00:02:14 +01:00
rdb 44e10d10a0 Support deploying Python apps for Android using bdist_apps 2021-12-07 21:00:08 +01:00
rdb 396e623aba android: Send nout to Android log, don't duplicate output to stderr 2021-12-06 22:24:36 +01:00
rdb 9dad304f85 interrogatedb: always define PyObject_CallNoArgs as inline 2021-12-06 22:23:44 +01:00
rdb 7dab0df061 cmath: Fix compilation error on macOS with sincos 2021-11-28 16:48:45 +01:00
rdb 480226a97a cmath: Use combined sincos on GNU where it is available 2021-11-28 16:14:36 +01:00
rdb df7892b683 dtoolutil: Fix _WIN32 macros that should be _MSC_VER 2021-11-16 16:35:13 +01:00
rdb 1739cef318 Merge branch 'release/1.10.x' into incoming 2021-08-31 14:03:57 +02:00
rdb 1fe5632ce2 interrogatedb: Fix compilation error on Windows due to typo 2021-08-30 21:37:54 +02:00
rdb 4a33e8866e dtoolbase: Add missing overloads for std::round on macOS 10.6 2021-08-04 13:35:27 +02:00
rdb 2a5b5030ba dtoolbase: Fix ability to use std::round() compiling for macOS 10.6 2021-08-04 13:18:43 +02:00
rdb 98054d1bbd interrogate: Support reverse binary operators as extension methods
Necessary for implementing #1048
2021-07-05 14:12:39 +02:00
rdb 18e8918138 interrogate: Reimplement subscript assignment "operator"
This redoes the handling of `obj[n] = item` to occur in InterrogateBuilder instead so that it doesn't prevent the same remap from being used as getitem.

This fixes the non-const variant of InstanceList[n].
2021-04-25 11:27:18 +02:00
rdb e9e1bb1bc6 dtoolutil/express: Resolving empty filename should yield no result
See #1140 - I may revert this if someone can demonstrate a compelling use case (for current directory, you can use "." instead), but it seems to have the potential to cause unintuitive behavior.
2021-04-09 18:26:00 +02:00
rdb dd3510eea7 Merge branch 'release/1.10.x' 2021-04-08 12:30:35 +02:00
rdb addbc8a2e8 dtoolutil: Work around odd Linux bug with lseek on a directory fd
Fixes #1140
2021-04-08 12:07:00 +02:00
rdb f3181bf684 Update version number on release/1.10.x branch to 1.10.10 2021-03-31 17:26:06 +02:00
rdb 51b6a90fcb dtoolbase: Remove hacky support code for old libstdc++ on macOS 2021-03-26 21:08:29 +01:00
rdb e6487651e7 prc: Fix bool conversion for empty/zero config variables 2021-03-09 19:40:24 +01:00
rdb fd5cab1a3f dtoolutil: Rename Filename::__nonzero__() to __bool__()
This is the Python 3 convention (even though interrogate supports both)
2021-03-09 19:35:09 +01:00
rdb e4ecb548bf interrogate: Use __bool__ for default name of operator bool 2021-03-09 19:33:50 +01:00
rdb 180a902978 parser-inc: Add some missing C++11/14/17/20 stdlib stubs 2021-03-02 14:18:13 +01:00
rdb 807be99f10 cppparser: Parse parenthesised noexcept() and explicit() 2021-03-02 13:31:00 +01:00
rdb 8eccc9f569 cppparser: Support __VA_OPT__ in variadic preprocessor defs 2021-03-02 13:07:27 +01:00
rdb 179f316b36 interrogate: Wrap anonymous parameter names as positional-only args 2021-03-01 19:33:43 +01:00
rdb f6b1b6dbb0 interrogate: Support three-way comparison operator <=> 2021-03-01 19:33:35 +01:00
rdb 684992cf8f cppparser: C++20 features: spaceship operator, char8_t, constinit/eval 2021-03-01 19:33:31 +01:00
rdb 8cbe36b352 Merge branch 'release/1.10.x' 2021-03-01 19:33:27 +01:00
rdb bdb2ef1631 pipeline: Fix crash upon exception in custom thread
We can't call PyErr_Restore() without a valid thread state, which won't exist in a custom thread if we just called PyGILState_Release().  Not sure how this has ever worked.
2021-03-01 16:19:53 +01:00
rdb eab1308438 interrogate: Fix bug sorting overloads of AsyncFuture::set_result() 2021-03-01 10:59:02 +01:00
rdb 4b24ac86a5 dtoolbase: Fix issues building with C++20 2021-03-01 10:16:03 +01:00
rdb 5ae08eadf7 Merge branch 'release/1.10.x' 2021-02-22 19:38:49 +01:00
rdb 7ed9f573e7 interrogate: Map operator / to true divide unless it takes an int
This is a little less conservative than the previous behaviour of only mapping if it takes a float, but this behaviour is more intuitive for non-scalar operands such as for Filename's operator /.
2021-02-22 19:14:18 +01:00
rdb 9d9337dc4d dtoolutil: Fix Filename division operator in Python 3 2021-02-22 18:14:12 +01:00
rdb 601ca323f5 interrogate: Support __truediv__, __floordiv__, etc. special methods 2021-02-22 18:13:34 +01:00
rdb fb9b334d58 Merge branch 'release/1.10.x' 2021-02-17 10:57:30 +01:00
rdb 08f344b00c dtool: Fix memory leak in OEncryptStream/IDecryptStream
Fixes #1114
2021-02-16 11:33:39 +01:00
rdb 8afd0e526f Merge branch 'release/1.10.x' 2021-02-15 11:38:45 +01:00
rdb 4dfe651133 prc: Fix istream/ostream/iostream properties of StreamWrapper 2021-02-15 11:13:33 +01:00