dev-2023-03
版本发布时间: 2023-03-03 19:56:20
odin-lang/Odin最新发布版本:dev-2024-09(2024-09-02 23:33:25)
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:
- Previous behaviour is available with
-terse-errors
- Automatic detection of ANSI colours is currently only supported for Windows
-
set ODIN_TERMINAL=ansi
to force ANSI colouring - Line printing with indication of the error location below
- Previous behaviour is available with
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
1、 odin-macos-amd64-dev-2023-03.zip 27.38MB
2、 odin-ubuntu-amd64-dev-2023-03.zip 51.42MB
3、 odin-windows-amd64-dev-2023-03.zip 47.14MB