メモリ管理
「メモリ管理」を扱った14問。日付を開くと、その日のドリルがそのまま読めます。日付の横の動物は難易度で、ハリネズミ・孔雀・バイソン・クジラの順に重くなります。
- Zig / WRITE · 2026-11-10 2つ確保して渡す std.mem.Allocator, errdefer, 確保の失敗, 所有権の受け渡し, dupe, checkAllAllocationFailures, caller owns memory, allocation failure
- Zig / READ · 2026-11-10 コピーした割り当て器 FixedBufferAllocator, std.mem.Allocator, アロケータのコピー, 確保位置, 領域の重なり, allocator interface, copied allocator state, aliasing
- Zig / DEBUG · 2026-11-10 アリーナで作って返す ArenaAllocator, std.mem.Allocator, 一時領域, 解放済みの領域, 所有権, defer arena.deinit, use after free, temporary allocation
- Zig / WRITE · 2026-11-02 書いた文字列を返す std.Io.Writer.Allocating, toOwnedSlice, defer, deinit, アロケータ, 所有権の受け渡し, allocating writer, caller owns memory
- Zig / WRITE · 2026-10-26 失敗の位置を返す複製 errdefer, catch |err|, 部分的な後始末, FailingAllocator, partial cleanup, error diagnostics, Allocator
- Zig / DEBUG · 2026-10-23 constの付いた型は別の型 @typeInfo, 構造体のフィールドの走査, inline for, 型の等値比較, []const u8, メモリリーク, type reflection, memory leak
- C / WRITE · 2026-10-14 1回のmallocで掛け算表 可変長配列, VLA, 配列へのポインタ, 2次元配列の動的確保, variable length array, pointer to array, malloc sizeof
- C / DEBUG · 2026-10-03 文字列を角括弧で囲む 文字数とバイト数, mallocの大きさ, ヒープバッファオーバーフロー, heap buffer overflow, strlen vs character count
- C / DEBUG · 2026-09-24 増える分の確保漏れ ヒープバッファオーバーフロー, mallocのサイズ不足, heap buffer overflow, buffer overflow
- Rust / DEBUG · 2026-09-13 再帰型にはBox 再帰的データ型, Box, サイズ不定, recursive type
- C / WRITE · 2026-09-13 木を後行順で解放 後行順, 木の解放, free, post-order
- C / WRITE · 2026-09-10 連続領域のint **行列 ポインタのポインタ, 動的な2次元配列, 行ポインタの表, malloc, pointer to pointer, dynamic 2D array, jagged array
- C / DEBUG · 2026-09-07 解放後に使う 解放後の使用, ダングリング, use after free
- C++ / DEBUG · 2026-08-21 自己代入で壊れる 自己代入, コピー代入演算子, self-assignment