- new_* functions in general moved to version without new_ prefix.

- `string::new_from_*` changed to `string::from_*`.
- `String.to_utf16_copy` and related changed to `String.to_utf16`.
- `String.to_utf16_tcopy` and related changed to `String.to_temp_utf16`
- `mem::temp_new` changed to `mem::tnew`.
- `mem::temp_alloc` and related changed to `mem::talloc`.
- `mem::temp_new_array` changed to `mem::temp_array`.
This commit is contained in:
Christoffer Lerno
2025-03-01 21:54:17 +01:00
committed by Christoffer Lerno
parent b35aafd3d5
commit c40198b016
24 changed files with 77 additions and 65 deletions

View File

@@ -159,7 +159,7 @@ fn Path! temp(String path, PathEnv path_env = DEFAULT_ENV)
fn Path! from_win32_wstring(Allocator allocator, WString path) => @pool(allocator)
{
return path::new(allocator, string::temp_from_wstring(path)!);
return path::new(allocator, string::tfrom_wstring(path)!);
}
fn Path! for_windows(Allocator allocator, String path)
@@ -261,10 +261,10 @@ fn Path! Path.absolute(self, Allocator allocator)
@pool(allocator)
{
const usz BUFFER_LEN = 4096;
WString buffer = (WString)mem::temp_alloc_array(Char16, BUFFER_LEN);
buffer = win32::_wfullpath(buffer, path_str.to_wstring_tcopy()!, BUFFER_LEN);
WString buffer = (WString)mem::talloc_array(Char16, BUFFER_LEN);
buffer = win32::_wfullpath(buffer, path_str.to_temp_wstring()!, BUFFER_LEN);
if (!buffer) return PathResult.INVALID_PATH?;
return { string::new_from_wstring(allocator, buffer), WIN32, allocator };
return { string::from_wstring(allocator, buffer), WIN32, allocator };
};
$else
String cwd = os::getcwd(tmem())!;