issue | c | zig (release-safe) | rust (release) | Nim (release) | Nim (danger) | D (@safe) | Swift | modern C++ |
---|---|---|---|---|---|---|---|---|
out-of-bounds heap read/write | none | runtime | runtime | runtime | none | runtime | runtime | none³ |
null pointer dereference | none | runtime | runtime | runtime | none | runtime¹ | runtime | none⁴ |
type confusion | none | runtime, partial | runtime | compile time | compile time | compile time | compile time | partial⁵ |
integer overflow | none | runtime | runtime | runtime | none | wraps | runtime (checked) | undefined behavior |
use after free | none | none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const math = std.math; | |
const assert = std.debug.assert; | |
const testing = std.testing; | |
pub const Policy = struct { | |
pub const SignPolicy = enum { | |
return_sign, | |
ignore_sign, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************************** | |
* apps/examples/leds_rust/leds_rust_main.rs | |
* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. The | |
* ASF licenses this file to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Zig v0.13.0 or master | |
//! Recommended `-Doptimize=ReleaseSmall` or `-Doptimize=ReleaseFast` (disabling sanitizer) | |
const std = @import("std"); | |
pub fn build(b: *std.Build) void { | |
const target = b.standardTargetOptions(.{}); | |
const optimize = b.standardOptimizeOption(.{}); | |
// -Duse_tb | |
const use_tb = b.option(bool, "use_tb", "Enable the tild backend") orelse false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Based on: https://github.com/denizzzka/ldc-external_druntime_backend/blob/external_druntime_backend_support/runtime/druntime/meson.build | |
const std = @import("std"); | |
const abs = @import("abs"); | |
const builtin = @import("builtin"); | |
pub fn build(b: *std.Build) !void { | |
// ldc2/ldmd2 not have mingw-support | |
const target = b.standardTargetOptions(.{ | |
.default_target = if (builtin.os.tag == .windows) |
- CPU: Ryzen 7 5700G (Zen3)
- RAM: 16 GiB
- DISK: SSD 470GiB (format: btrfs)
- SO: ArchLinux (last upd installed: 20-05-2024)
Original post: kubo39/gist 🇯🇵
A cache algorithm called [SIEVE][sieve-website] was announced in 2023. It claims to be simpler than LRU, and indeed it is a fairly simple algorithm, but it is said to perform as well as existing superior cache algorithms such as S3-FIFO and TinyLFU.
updated: https://godbolt.org/z/fqT37xGPM - add Dlang and fix c++ initialize_list
Not installed .NET
# D betterC
Benchmark 1 (121 runs): ./structmem_rs
Zig toolchain [forked] uses LLVM codegen for mos target.
Current version:
- Zig: v0.13.0-dev (bootstrap fork)
- LLVM: v18.0.0 (llvm-fork)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
../zig-bootstrap/out/zig-x86_64-linux-musl-baseline/zig build -Dtarget=native-native-msvc -DBUILD_SHARED_LIBS=true -Ddisable_handle_fork=false -Denable_cplusplus=true -Denable_gc_assertions=true -Denable_gc_debug=true -Denable_large_config=false -Denable_munmap=true -Denable_parallel_mark=false -Denable_redirect_malloc=false -Denable_rwlock=true -Denable_thread_local_alloc=true -Denable_threads=true -Denable_werror test -fwine | |
steps [5/43] zig build-exe initfromthreadtest Debug native-native-msvc... Created 205 threads (174 ended) | |
GC_check_heap_block: found 1 smashed heap objects: | |
0x79c926ed4db8 in or near object at 0x79c926ed4d90 (/app/bdwgc/tests/smash.c:34, sz= 40) | |
Call chain at allocation: | |
steps [12/43] zig build-exe realloctest Debug native-native-msvc... Heap size: 65536 | |
Heap size: 131072 | |
sh: 1: /usr/bin/addr2line: not found | |
/app/bdwgc/zig-cache/o/ed2c75516bbcd33b227e2d90c7f211f1/libgc.so(+0x4596b) [0x79c9272a596b] | |
/app/bdwgc/zig-cache/o/ed2c75516bbcd33b227e2d90c |
NewerOlder