mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Replace static initializer with @init / @finalizer
This commit is contained in:
committed by
Christoffer Lerno
parent
757a5b58e8
commit
4cc30c0d33
@@ -76,8 +76,6 @@ enum CallLocation : int(String name)
|
||||
MACRO("macro"),
|
||||
LAMBDA("lambda"),
|
||||
TEST("test"),
|
||||
INITIALIZER("initializer"),
|
||||
FINALIZER("finalizer")
|
||||
}
|
||||
|
||||
struct CallstackElement
|
||||
@@ -427,7 +425,7 @@ fn void install_signal_handler(CInt signal, SignalFunction func) @local
|
||||
}
|
||||
|
||||
// Clean this up
|
||||
static initialize @priority(101)
|
||||
fn void install_signal_handlers() @init(101) @local
|
||||
{
|
||||
install_signal_handler(libc::SIGBUS, &sig_bus_error);
|
||||
install_signal_handler(libc::SIGSEGV, &sig_segmentation_fault);
|
||||
|
||||
@@ -656,7 +656,7 @@ module std::core::mem @if(WASM_NOLIBC);
|
||||
SimpleHeapAllocator wasm_allocator @private;
|
||||
extern int __heap_base;
|
||||
|
||||
static initialize @priority(1)
|
||||
fn void initialize_wasm_mem() @init(1) @private
|
||||
{
|
||||
allocator::wasm_memory.allocate_block(mem::DEFAULT_MEM_ALIGNMENT)!!; // Give us a valid null.
|
||||
// Check if we need to move the heap.
|
||||
|
||||
Reference in New Issue
Block a user