mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 10:00:16 +02:00
docs: Update ProgrammingConcerns
Disallow all APIs that touch `FILE`, they all allocate memory that we don't control.
This commit is contained in:
1 file changed
+5
-5
@@ -82,13 +82,13 @@ Use `FHU::Filesystem::CopyFile` instead.
|
||||
#### std::filesystem::temp_directory_path
|
||||
See `GetTempFolder()` in `FEXServerClient.cpp` (split/move to `FHU::Filesystem` if needed by other users).
|
||||
|
||||
### `std::fstream`
|
||||
### Any api that uses `FILE`
|
||||
This API always allocates memory and should be avoided.
|
||||
Use a combination of open and fextl::string APIs instead of fstream.
|
||||
Use a combination of raw FDs and fextl::string APIs instead of fstream.
|
||||
|
||||
### `std::fwrite`
|
||||
This API allocates a buffer in the background for buffering output.
|
||||
Use raw `write` instead.
|
||||
#### Includes but not limited to:
|
||||
* `<fstream>` -> `std::fstream`
|
||||
* `<cstdio>` -> `std::fwrite`
|
||||
|
||||
### `std::string`
|
||||
Use `fextl::string` instead.
|
||||
|
||||
Reference in new issue
Block a user