mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Merge remote-tracking branch 'offical/master'
This commit is contained in:
@@ -825,16 +825,18 @@ map_insert :: proc(m: ^$T/map[$K]$V, key: K, value: V, loc := #caller_location)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Explicitly inserts a key and value into a map `m`, the same as `map_insert`, but the return values differ.
|
// Explicitly inserts a key and value into a map `m`, the same as `map_insert`, but the return values differ.
|
||||||
// - `prev_key_ptr` will return the previous pointer of a key if it exists, and `nil` otherwise.
|
// - `prev_key` will return the previous pointer of a key if it exists, check `found_previous` if was previously found
|
||||||
// - `value_ptr` will return the pointer of the memory where the insertion happens, and `nil` if the map failed to resize
|
// - `value_ptr` will return the pointer of the memory where the insertion happens, and `nil` if the map failed to resize
|
||||||
// - `found_previous` will be true if `prev_key_ptr != nil`
|
// - `found_previous` will be true a previous key was found
|
||||||
@(require_results)
|
@(builtin, require_results)
|
||||||
map_insert_and_check_for_previous :: proc(m: ^$T/map[$K]$V, key: K, value: V, loc := #caller_location) -> (prev_key_ptr: ^K, value_ptr: ^V, found_previous: bool) {
|
map_upsert :: proc(m: ^$T/map[$K]$V, key: K, value: V, loc := #caller_location) -> (prev_key: K, value_ptr: ^V, found_previous: bool) {
|
||||||
key, value := key, value
|
key, value := key, value
|
||||||
kp, vp := __dynamic_map_set_extra_without_hash((^Raw_Map)(m), map_info(T), rawptr(&key), rawptr(&value), loc)
|
kp, vp := __dynamic_map_set_extra_without_hash((^Raw_Map)(m), map_info(T), rawptr(&key), rawptr(&value), loc)
|
||||||
prev_key_ptr = (^K)(kp)
|
if kp != nil {
|
||||||
value_ptr = (^V)(vp)
|
prev_key = (^K)(kp)^
|
||||||
found_previous = kp != nil
|
found_previous = true
|
||||||
|
}
|
||||||
|
value_ptr = (^V)(vp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -56,7 +56,7 @@ fi
|
|||||||
|
|
||||||
case "$OS_NAME" in
|
case "$OS_NAME" in
|
||||||
Darwin)
|
Darwin)
|
||||||
if [ "$OS_ARCH" == "arm64" ]; then
|
if [ "$OS_ARCH" = "arm64" ]; then
|
||||||
if [ $LLVM_VERSION_MAJOR -lt 13 ] || [ $LLVM_VERSION_MAJOR -gt 17 ]; then
|
if [ $LLVM_VERSION_MAJOR -lt 13 ] || [ $LLVM_VERSION_MAJOR -gt 17 ]; then
|
||||||
error "Darwin Arm64 requires LLVM 13, 14 or 17"
|
error "Darwin Arm64 requires LLVM 13, 14 or 17"
|
||||||
fi
|
fi
|
||||||
@@ -101,7 +101,7 @@ build_odin() {
|
|||||||
EXTRAFLAGS="-O3"
|
EXTRAFLAGS="-O3"
|
||||||
;;
|
;;
|
||||||
release-native)
|
release-native)
|
||||||
if [ "$OS_ARCH" == "arm64" ]; then
|
if [ "$OS_ARCH" = "arm64" ]; then
|
||||||
# Use preferred flag for Arm (ie arm64 / aarch64 / etc)
|
# Use preferred flag for Arm (ie arm64 / aarch64 / etc)
|
||||||
EXTRAFLAGS="-O3 -mcpu=native"
|
EXTRAFLAGS="-O3 -mcpu=native"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user