dev-2023-03
gingerBill
released this
03 Mar 11:56
·
5701 commits
to master
since this release
New Language Features
- BREAKING CHANGE: Brand New Default
context.temp_allocator
Implementation- 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
struct
or 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
using
in 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
byval
parameters on Darwin SysV ABI which in turn fixes#by_ptr
- Rename to
runtime.Type_Info_Parameters
for 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_all
free all memory blocks except for the first one virtual.arena_destroy
will free all memory blocks including the first one (assuming Growing or Static)
- On
- Add
#optional_allocator_error
tomake_map
- Numerous improvements to the
vendor:directx
packages