Commit graph

307 commits

Author SHA1 Message Date
Nekotekina f5e529db61 shared_ptr.hpp: don't use fake objects
This lifts the limitation for casting with abstract classes.
Use new C++20 feature (constexpr allocator) to test viability.
Add SamePtr concept to types.hpp
2021-05-30 15:07:17 +03:00
Nekotekina eec9578619 types.hpp: add PtrCastable concept 2021-05-29 18:32:13 +03:00
Nekotekina 7311c161f6 vm_native: fix Linux/Posix sparse file check
Fix fast path condition (xnor is not ==, facepalm).
Increase probe size.
Should fix #10334
Closes #10335

Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
2021-05-25 09:55:43 +03:00
Nekotekina 5db38c0127 vm_native: improve sparse file check (Linux/BSD)
Use lseek(FIND_DATA) to check for sparse file support.
2021-05-24 18:21:52 +03:00
Nekotekina 191cb92300 vm_native: improve sparse file implementation (Win32)
Fix sparse attribute set/check, improve logic.
Implement actual check of file data.
Ask to restart RPCS3 first time (Win7 bug).
2021-05-24 18:21:52 +03:00
Nekotekina 2491aad6f2 types.hpp: implement min_v<>, max_v<>, SignedInt, UnsignedInt, FPInt concepts
Restrict smax to only work with signed values for consistency.
Cleanup <climits> includes.
Cleanup <limits> includes.
2021-05-23 19:43:51 +03:00
Nekotekina 4b239a0b87 types.hpp: rewrite _u16-_u64 suffixes
_u48 is unused and gone, blends into _u64.
2021-05-23 07:33:54 +03:00
Nekotekina 2768727e2f types.hpp: replace custom std::bit_cast
Remove memcpy version.
Use builtin instead.
2021-05-23 07:33:19 +03:00
Nekotekina 160b131de3 types.hpp: implement smin, smax, amin, amax
Rewritten the following global utility constants:
`umax` returns max number, restricted to unsigned.
`smax` returns max signed number, restricted to integrals.
`smin` returns min signed number, restricted to signed.
`amin` returns smin or zero, less restricted.
`amax` returns smax or umax, less restricted.

Fix operators == and <=> for synthesized rel-ops.
2021-05-22 12:10:57 +03:00
Nekotekina 613777afde vm_native: try to workaround another bug (Win32)
Resize sparse file gradually.
2021-05-22 08:16:54 +03:00
Nekotekina c646476ca8 logs.hpp: another fixup for RPCS3.log
Don't print channel names for initial messages.
2021-05-21 00:41:37 +03:00
Nekotekina de94f6c2f6 logs.hpp: fix fatal typo 2021-05-20 19:10:51 +03:00
Nekotekina 04cac6cd33 logs.hpp: refactoring (logs::message)
Make .error/.warning/... callable objects which can be pointed to.
Make .always() more hard to access.
Memory layout optimizations.
2021-05-20 01:08:32 +03:00
Nekotekina 1d0f6eebdc Improve error_code (new formatting constructor)
Minor cleanup in formatting utilities.
2021-05-19 22:41:16 +03:00
Nekotekina 16620f6835 vm_native: sparse file fixup (Win32)
Clear file if it occupies blocks.
Makes it more fool-proof and fixes possible bug.
2021-05-19 22:41:16 +03:00
Nekotekina 6e497ae372 vm: disable sparse files on win7 2021-05-18 13:31:46 +03:00
Nekotekina 2a26bc6668 Fix page mapping rights to file mapping 2021-05-13 13:49:24 +03:00
Nekotekina f0ad20a250 Implement const_str_t<> helper 2021-05-13 10:23:33 +03:00
Nekotekina 126141cdce vm_native: improve sparse file handling
Don't specify O_TRUNC every time.
Add portable support test (Linux/Unix).
Use PAGE_WRITECOPY (Windows).
2021-05-13 10:23:33 +03:00
Nekotekina 0bd64a0e72 Don't fatal on sparse file initialization failure
Also try two different locations (Win32).
2021-05-10 00:39:28 +03:00
Nekotekina 327c000c82 Implement s128 type (based on u128) 2021-05-04 18:02:52 +03:00
Nekotekina 1b0b2fe21e vm: add "hook" memory (32G)
Implement overcommit emulation for shm.
2021-05-04 18:02:52 +03:00
Nekotekina e327d47169 vm_native: add cow flag to map functions
CoW is copy-on-write mapping type.
2021-05-04 09:53:19 +03:00
Nekotekina 3fc6375ec5 Use consteval (experimental) 2021-04-29 23:16:43 +03:00
Nekotekina f8e05f8e3c Remove redundant operators != 2021-04-29 22:57:40 +03:00
Nekotekina 5724d2d4c7 Simplify umax
Add operator less and conversion operator.
2021-04-29 12:21:12 +03:00
Nekotekina b1736b6411 Simplify utils::umulh64 (MSVC) 2021-04-29 09:45:57 +03:00
Nekotekina 4d9a167f56 u128: add multiplication support (for MSVC) 2021-04-25 18:17:38 +03:00
Nekotekina b704cc8375 shared_ptr.hpp: implement make_single_value(), make_shared_value()
A function that constructs single_ptr from its argument.
Type can be deduced from the argument (unlike make_single).
2021-04-25 18:17:38 +03:00
Nekotekina e34c956196 shared_ptr.hpp: add invoke operator 2021-04-25 18:17:38 +03:00
Nekotekina 0c9c481cee Use requires syntax in more places
Change style in some places.
2021-04-19 16:51:40 +03:00
Nekotekina 7dae376646 Implement fill_array() utility 2021-04-19 12:33:32 +03:00
David Carlier b6732fbae9 MacOs build fix proposal.
Made on Big Sur, removing few unnecessary old specifics.
Build with LLVM homebrew.
2021-04-18 17:18:09 +03:00
Nekotekina 7a9561b966 vm_native: document some unmap_critical behaviour (posix) 2021-04-18 13:13:15 +03:00
Nekotekina c061991c43 vm_native: supply only one madvise flag at a time 2021-04-18 13:13:15 +03:00
David Carlier 266c4209c4 VM: FreeBSD c_madv_no_dump/dump constants support. 2021-04-17 20:47:36 +03:00
Eladash 67e2e154fa Replace simple_type with std::common_type 2021-04-17 10:27:55 +03:00
Nekotekina 408ffd3d2c fxo: add debug name to the typeinfo 2021-04-15 20:01:29 +03:00
Nekotekina a211895e28 shared_ptr.hpp: use for fs::virtual_device
Add new constructors for single_ptr and shared_ptr.
Change virtual device prefix format.
2021-04-15 17:26:47 +03:00
p01arst0rm c9d2aed286 small collection of fixes 2021-04-15 11:05:15 +03:00
Megamouse a16d8ba3ea More random changes 2021-04-11 14:01:51 +03:00
Nekotekina 8c5f2b249c shared_ptr.hpp: further fixes
Improved is_same_ptr() trait (added third "maybe" category).
Fallback to pseudo-runtime check in certain cases (if "maybe").
Fix single_ptr moving assignment operator.
2021-04-09 10:26:13 +03:00
Nekotekina 332c512eed shared_ptr.hpp: minor optimization (GCC hotfix)
Use thread_local for dummy objects (doesn't work on MSVC).
Couldn't find better way to remove fake static objects completely.
In a sense that they don't appear in object files.
2021-04-09 10:26:13 +03:00
Nekotekina 94c62b1eec shared_ptr.hpp: improve is_same_ptr<> trait
Don't always return true on MSVC.
2021-04-08 10:29:47 +03:00
Nekotekina 963d150e93 Fix some -Weffc++ warnings (part 2) 2021-04-03 21:54:15 +03:00
Nekotekina 2212a131ef Fix some -Weffc++ warnings (part 1) 2021-03-31 11:27:09 +03:00
Nekotekina 729757b1dd atomic.hpp: allow raw notify_all by pointer 2021-03-23 20:58:42 +03:00
Nekotekina 393f9d329d atomic.cpp: allow non-standard sizes in atomic wait (>16) 2021-03-23 20:52:56 +03:00
Nekotekina 820390b7ed atomic.cpp: remove raw_notify and simplify internal logic
Also permit zero size in waiters.
2021-03-23 20:19:10 +03:00
Eladash cd6ef2958b Add information about unnamed/main threads in logs and fatal dialog
* If thread is unnamed, keep log name empty for main thread, otherwise print thread id. In fatal dialog, main thread can be handled differently (with special remark that it's main thread).
* Always print thread id in fatal dialog, regardless of thread type.

Co-authored-by: Nekotekina <nekotekina@gmail.com>
2021-03-11 22:55:06 +03:00