New Language Features
- BREAKING CHANGE: Brand New Default
context.temp_allocatorImplementation- New version is a growing arena based approach
- Old version used an unsafe ring buffer
- IMPORTANT
free_all(context.temp_allocator)must be called to clear the contents of the internal arena (unlike the previous ring buffer)- It is recommended that this is done per frame/cycle/etc
- New version is a growing arena based approach
expand_values()- Built-in procedure which expands a
structor fixed-length array into multiple values
- Built-in procedure which expands a
Foo :: struct {x: f32, y: i32}
f := Foo{1, 2}
a, b := expand_values(f)
assert(a == 1 && b == 2)- Allow comparisons between empty
struct{}andunion{} - Allow for assigning to fields through
usingin a compound literal
Foo :: struct {
using x: struct { // named `using` fields
y: int,
},
z: f32
using _: struct { // anonymous `using` fields
w: bool,
},
}
f := Foo{
y = 123, // equivalent to `x = {y = 123},`
z = 456,
w = true,
}- Verbose error messages by default with optional ANSI colouring too:
Compiler Improvements
@(fini)to complement its opposite@(init)- Fix to
byvalparameters on Darwin SysV ABI which in turn fixes#by_ptr - Rename to
runtime.Type_Info_Parametersfor procedures inputs and outputs - Fix issue that conflicts with constant parapoly procedure literals and
@(deferred_*) - Numerous improvements to error messages
New Packages
Package Improvements
- Introduction of
time.tsc_frequency() - Improvements to
core:mem/virtual'sArena- On
free_allfree all memory blocks except for the first one virtual.arena_destroywill free all memory blocks including the first one (assuming Growing or Static)
- On
- Add
#optional_allocator_errortomake_map - Numerous improvements to the
vendor:directxpackages
