Commit Graph

2107 Commits

Author SHA1 Message Date
rdb c62d2319e0 CMake: Add --exclude-libs flags to static thirdparty libraries
Matching makepanda, this avoids symbol conflicts and may have optimization benefits.

This is a temporary hack until CMake 3.24 is released, which offers a cleaner way of doing this.
2022-03-09 16:23:37 +01:00
rdb 657a8f890c interrogate: Squelch weird "Manifests" output from interrogate_module 2022-03-09 16:23:37 +01:00
rdb dae147ec0c Merge branch 'release/1.10.x' 2022-03-02 10:51:23 +01:00
rdb 46c1b887ea Fix heap alignment with SSE2 on 32-bit Windows by inheriting MemoryBase
Fixes #510
2022-03-02 09:57:44 +01:00
rdb 370b635534 dtoolbase: Fix missing __stdcall when compiling for 32-bit Windows 2022-03-02 09:57:24 +01:00
rdb a0be50c769 general: Fix assorted compiler warnings 2022-03-01 16:09:07 +01:00
rdb 21377c8de5 Use secure versions of CRT getenv etc. when compiling with MSVC 2022-03-01 16:09:07 +01:00
rdb dc05889be2 dtoolutil: Don't use $HOME in Filename::get_home_directory() on Windows
This variable isn't used on Windows systems
2022-03-01 16:09:07 +01:00
rdb 70415af210 dtoolutil: Set system malloc tag to mimalloc when enabled 2022-03-01 15:12:38 +01:00
rdb 583c9f1857 pipeline: Fix issues with calling convention on 32-bit Windows 2022-03-01 12:19:13 +01:00
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 a37dfa727e makepanda: Support building with mimalloc on Windows, experimentally
Partial backport of 07545bc9e3 for Windows, requires building with `--override USE_MEMORY_MIMALLOC=1 --override USE_DELETED_CHAIN=UNDEF` for optimum effect
2022-02-06 15:29:25 +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 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 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