mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- AnyList now also defaults to the temp allocator.
- `os::getcwd` and `os::get_home_dir` requires an explicit allocator. - `file::load_new` and `file::load_path_new` removed.
This commit is contained in:
@@ -66,7 +66,7 @@ fn bool set_var(String name, String value, bool overwrite = true) => @pool()
|
||||
<*
|
||||
Returns the current user's home directory.
|
||||
*>
|
||||
fn String? get_home_dir(Allocator using = allocator::heap())
|
||||
fn String? get_home_dir(Allocator allocator)
|
||||
{
|
||||
String home;
|
||||
$if !env::WIN32:
|
||||
@@ -74,7 +74,7 @@ fn String? get_home_dir(Allocator using = allocator::heap())
|
||||
$else
|
||||
home = "USERPROFILE";
|
||||
$endif
|
||||
return get_var(using, home);
|
||||
return get_var(allocator, home);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ fn uptr? load_address() @local
|
||||
}
|
||||
|
||||
|
||||
fn Backtrace? backtrace_load_element(String execpath, void* buffer, void* load_address, Allocator allocator = allocator::heap()) @local
|
||||
fn Backtrace? backtrace_load_element(Allocator allocator, String execpath, void* buffer, void* load_address) @local
|
||||
{
|
||||
@pool()
|
||||
{
|
||||
@@ -150,7 +150,7 @@ fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)
|
||||
String execpath = executable_path(tmem())!;
|
||||
foreach (addr : backtrace)
|
||||
{
|
||||
list.push(backtrace_load_element(execpath, addr, load_addr, allocator) ?? backtrace::BACKTRACE_UNKNOWN);
|
||||
list.push(backtrace_load_element(allocator, execpath, addr, load_addr) ?? backtrace::BACKTRACE_UNKNOWN);
|
||||
}
|
||||
};
|
||||
return list;
|
||||
|
||||
@@ -26,7 +26,7 @@ macro ObjcClass? class_by_name(ZString c)
|
||||
return cls ?: CLASS_NOT_FOUND?;
|
||||
}
|
||||
|
||||
macro ObjcClass[] class_get_list(Allocator allocator = allocator::heap())
|
||||
macro ObjcClass[] class_get_list(Allocator allocator)
|
||||
{
|
||||
int num_classes = objc::getClassList(null, 0);
|
||||
if (!num_classes) return {};
|
||||
|
||||
Reference in New Issue
Block a user