Ryan Houdek
49abe8afb5
Allocator: Remove pointer indirection overhead
...
Every time we are calling a function in `FEXCore::Allocator::` this is a
pointer indirection. Which means on x86 it is always a `call [rdi]` and
on AArch64 it is a `ldr x17, [x0]; blr x17;`.
Instead of doing this, use inline functions in the header that call the
correct allocation function directly. This function gets inlined and is
no longer an indirect call.
When compiling with jemalloc, we forward declare the jemalloc function
definitions so we don't have to pull in the entire jemalloc interface in
to the public header definitions.
2023-04-11 10:29:35 -07:00
Ryan Houdek
466edf7744
fextl::fmt: Remove fwrite usage
...
fwrite allocates some backing memory for buffering outputs which FEX
can't track.
Switch to using `fileno` to get the fd from the FILE and write directly.
This will need to be changed for llvm-mingw support but that will come after
this.
This will be added to the documentation that we can't use fwrite.
2023-04-10 17:43:47 -07:00
Ryan Houdek
1864a1d3b5
fextl::fmt: Add print with std::FILE* handler
...
This is to match prior behaviour, but untested if fwrite itself
allocates any memory so far.
2023-04-10 15:38:55 -07:00
Ryan Houdek
e98a46aa5f
Review comments
2023-04-07 17:01:53 -07:00
Ryan Houdek
265c918d90
Move fextl::String_from_path to the only usage in FEXConfig
...
Ensures that people won't be tempted to use this elsewhere.
2023-04-07 17:01:53 -07:00
Ryan Houdek
11402b637a
fextl: Remove now unused string_from_string
2023-04-07 17:01:52 -07:00
Ryan Houdek
4d70f4fc4e
Remove some unused headers now.
2023-04-07 17:01:52 -07:00
Ryan Houdek
4ab822aebb
IRParser: Convert to fextl
2023-04-07 17:01:52 -07:00
Ryan Houdek
2d18156e15
AOT: Convert fstream to fextl and raw files
2023-04-07 17:01:52 -07:00
Ryan Houdek
7180bb1496
GdbServer: Convert fstream to fextl
2023-04-07 17:01:51 -07:00
Ryan Houdek
8a711383bb
fextl/fmt: Adds print helper that takes FD
2023-04-07 17:01:51 -07:00
Ryan Houdek
257a3a54dc
Context: Convert over to a unique_ptr
2023-04-07 17:01:51 -07:00
Ryan Houdek
9e5971b89c
Allocator: Disable glibc sbrk allocations
...
This is done by consuming a single page at the end of the current sbrk
memory region. Then consuming any remaining bytes that could have
potentially ended up in it.
This ensures that glibc won't be able to return 64-bit pointers to
32-bit thunks once the remaining work is in place.
2023-04-06 12:27:44 -07:00
Ryan Houdek
546a1edb55
CodeReview
2023-04-01 09:27:01 -07:00
Ryan Houdek
97daec3dba
Review comments
2023-03-31 06:03:06 -07:00
Ryan Houdek
53bbbd5a4f
Review code
2023-03-30 16:28:34 -07:00
Ryan Houdek
4f66ff6ec4
Paths: Remove unique_ptr usage
2023-03-30 16:28:34 -07:00
Ryan Houdek
067f807405
InternalThreadState: Convert tsl to fextl
2023-03-30 16:28:34 -07:00
Ryan Houdek
463b4b748c
fextl: Add fextl::fmt::print
2023-03-30 16:28:34 -07:00
Ryan Houdek
a14353bc3c
FEXLoader: Convert remaining usages away from glibc
2023-03-30 16:28:34 -07:00
Ryan Houdek
1eb36b8b31
Convert a ton of things over to fextl
2023-03-30 16:28:33 -07:00
Ryan Houdek
141dddc83e
CMake: Adds glibc allocator fault option
...
This will be used for CI to ensure FEX doesn't use the glibc allocator
2023-03-30 08:49:26 -07:00
Ryan Houdek
f02a111d33
fextl: add memory for unique_ptr and make_unique
2023-03-30 08:49:26 -07:00
Ryan Houdek
79f7baffe3
fextl: Add pmr default resource
2023-03-30 08:49:26 -07:00
Ryan Houdek
7150c532f3
fextl: add robin_map
2023-03-30 08:49:26 -07:00
Ryan Houdek
e48fb1850e
fextl: add unordered_multimap
2023-03-30 08:49:26 -07:00
Ryan Houdek
7022b3b825
Review c_str() changes
2023-03-23 12:45:14 -07:00
Ryan Houdek
6016c48f98
SourcecodeResolver: Resolve review
2023-03-23 08:19:12 -07:00
Ryan Houdek
bed10000e4
fextl: Add fmt
2023-03-23 08:15:47 -07:00
Ryan Houdek
0ab2a550b1
FEXCore: Convert string to fextl
2023-03-16 03:21:46 -07:00
Ryan Houdek
e5867b89ed
FEXCore: Convert sstream to fextl
2023-03-16 03:21:46 -07:00
Ryan Houdek
3f98eff6e5
AOT: Convert string to fextl
2023-03-16 03:21:46 -07:00
Ryan Houdek
45493ad3ef
fextl: Add sstream
2023-03-16 03:21:46 -07:00
Ryan Houdek
fe886716a4
Config: Convert string to fextl
...
This sprawled out to lots of places as expected
2023-03-16 03:21:45 -07:00
Ryan Houdek
e9a0d95c65
Telemetry: Convert string to fextl
...
Kind of sprawled a bit.
2023-03-16 03:21:45 -07:00
Ryan Houdek
24101d99ac
CPUBackend: Convert string to fextl
2023-03-16 03:21:45 -07:00
Ryan Houdek
7d226a6b18
SourcecodeResolver: Convert string to fextl
2023-03-16 03:21:45 -07:00
Ryan Houdek
5092675179
fextl/string: Add hash so it can exist in hashmaps
2023-03-16 03:21:45 -07:00
Ryan Houdek
8941b8a312
Convert the rest of vector to fextl
2023-03-16 03:03:08 -07:00
Ryan Houdek
a7334608fa
fextl: Move allocator hooks to its own header
2023-03-16 03:03:08 -07:00
Ryan Houdek
54c33b07a2
ELFCodeLoader: Convert to fextl
...
Kind of sprawls all over the place
2023-03-16 03:03:08 -07:00
Ryan Houdek
e30f3bd0c8
fextl: Implement queue
2023-03-15 12:22:04 -07:00
Ryan Houdek
bd3facde63
fextl: Implement stack
2023-03-15 12:22:04 -07:00
Ryan Houdek
92f2dc0737
ThreadPoolAllocator: Convert list to fextl
2023-03-15 12:22:04 -07:00
Ryan Houdek
5b97e6d354
Config: Convert list to fextl
...
Needs #2506 merged first. First commit is cherry-picked from it.
2023-03-15 12:22:04 -07:00
Ryan Houdek
7b790903c9
AOT: Convert set to fextl
...
This worms its way all the way to the frontend
2023-03-15 12:16:03 -07:00
Ryan Houdek
18c9e84543
Config: Convert unordered_map to fextl
...
Needs #2506 merged first. First commit is cherry-picked from it.
2023-03-15 12:11:41 -07:00
Ryan Houdek
97565b68db
LinuxSyscalls: Convert vector to fextl
2023-03-15 12:10:21 -07:00
Ryan Houdek
6b053d298e
VDSOEmulation: Convert vector to fextl
...
Pipes back to thunk definitions in FEXCore as well.
2023-03-15 12:08:58 -07:00
Ryan Houdek
df17f7adbb
JITs: Convert relocations vector to fextl
...
Kind of goes places.
2023-03-15 12:05:12 -07:00