Nekotekina
ad1027455a
Fix minor inconsistency in utils::memory_reset (Linux)
2021-02-22 13:00:01 +03:00
Nekotekina
8e6e57de86
Enable -Wunused-function warning
2021-02-15 14:39:53 +03:00
Nekotekina
caa83d20f7
vm_native.cpp: implement shm::try_map
...
Treats addr as a hint, emulating windows behaviour.
2021-01-25 16:55:19 +03:00
kd-11
ead180aa60
win32: Be a bit more optimistic with allocated ranges; we get contiguous ranges more often than not
2021-01-24 14:24:55 +03:00
Nekotekina
0ac68def49
vm_native.cpp: minor compilation fix
2021-01-17 15:14:11 +03:00
Nekotekina
4ed76a15ff
Use different approach in shm::unmap_critical (Linux)
...
For now, set protection to PROT_NONE.
Attempt to address #9609
2021-01-15 20:11:09 +03:00
Nekotekina
b5837d1271
Memory: use MADV_DONTDUMP if available (Linux)
...
Also refactor other madvise() usage
2021-01-15 19:54:41 +03:00
Nekotekina
ea916fd7e1
Memory: fix critical bug in shm::unmap_critical (Linux)
...
It was leaving holes in reserved areas.
Windows is unaffected.
2021-01-14 18:04:29 +03:00
Eladash
923fcc3b3d
utils::shm: Hotfix after #9578
2021-01-12 23:57:36 +03:00
Eladash
c50b9bc4b4
utils::shm: Make map_self() atomic ( #9578 )
2021-01-12 19:53:18 +03:00
Nekotekina
db8e6fe7a7
Enable -Wunused-variable
2021-01-12 14:34:14 +03:00
Nekotekina
e3dec420a2
vm_native.cpp: conditionally define c_madv_free
2020-12-27 12:19:50 +03:00
Nekotekina
1e32311a65
Use MAP_NORESERVE when available in mmap (Linux)
...
Used in: memory_reserve, memory_decommit (vm_native.cpp)
2020-12-27 10:20:42 +03:00
Nekotekina
eec11bfba9
Move align helpers to util/asm.hpp
...
Also add some files:
GLTextureCache.cpp
VKTextureCache.cpp
2020-12-18 18:07:42 +03:00
Nekotekina
fb29933d3d
Add usz alias for std::size_t
2020-12-18 12:23:53 +03:00
Nekotekina
e055d16b2c
Replace verify() with ensure() with auto src location.
...
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
Nekotekina
2b674d4d8c
utils::shm: allow 2M hugepages on demand
2020-11-25 10:41:17 +03:00
Nekotekina
487b572aa6
Linux: remove assertions on MADV_HUGEPAGE
...
It's a hint and is allowed to fail.
2020-11-25 10:41:17 +03:00
Nekotekina
ab248e170c
vm_native.cpp: add MADV_HUGEPAGE
...
It enables Transparend Huge Pages for some regions on Linux.
Although it can't be actively useful, it seems to do something.
Maybe it's even harmful for recompilers.
2020-11-24 12:31:11 +03:00
Nekotekina
d1ee7c651f
Make memory locking optional (mlock, VirtualLock).
...
Fix desired locking operation (to fix "sudo" memory).
It was discovered that some systems have outdated configuration.
With too tight limit, it's almost impossible to lock anything in memory.
2020-11-10 06:05:37 +03:00
Nekotekina
dcbe8ef5f4
Import VirtualAlloc2 if available (Win10+)
...
Import MapViewOfFile3 as well.
Unused, this crap is tricky.
2020-11-10 03:04:38 +03:00
Nekotekina
e98eb4659e
Implement utils::memory_lock
2020-11-09 22:57:36 +03:00
Nekotekina
d1988d384c
vm: remove unnecessary memset() on stop
2020-11-09 22:57:36 +03:00
Nekotekina
b05d12df0e
Hotfix for shm->map_self()
...
Make sure mmap returns 64K-aligned results, as on Windows.
2020-11-08 22:15:59 +03:00
Nekotekina
1c99a2e7fb
vm: add map_self() method to utils::shm
...
Add complementary unmap_self() method.
Move VirtualMemory to util/vm.hpp
Minor associated include cleanup.
Move asm.h to util/asm.hpp
2020-11-08 16:43:15 +03:00