Stabilize process execution and editor cleanup
This commit is contained in:
@@ -726,8 +726,8 @@ API double GetTimeSeconds() {
|
||||
return GetTimeMicros() / 1000000.0;
|
||||
}
|
||||
|
||||
API String WriteTempFile(String data) {
|
||||
Scratch scratch;
|
||||
API String WriteTempFile(Allocator allocator, String data) {
|
||||
Scratch scratch(allocator);
|
||||
|
||||
#if OS_WINDOWS
|
||||
int buffer_len = MAX_PATH+1;
|
||||
@@ -737,12 +737,12 @@ API String WriteTempFile(String data) {
|
||||
Assert(result != 0);
|
||||
String16 temp16 = {buffer, result};
|
||||
NormalizePathInPlace(temp16);
|
||||
String temp_directory = ToString(scratch, temp16);
|
||||
String temp_directory = ToString(allocator, temp16);
|
||||
#else
|
||||
String temp_directory = "/tmp";
|
||||
#endif
|
||||
|
||||
String temp_filename = Format(scratch, "%S/temp%llu", temp_directory, GetTimeNanos());
|
||||
String temp_filename = Format(allocator, "%S/temp%llu", temp_directory, GetTimeNanos());
|
||||
bool done = WriteFile(temp_filename, data);
|
||||
Assert(done);
|
||||
return temp_filename;
|
||||
|
||||
Reference in New Issue
Block a user