hack のためのネタ帳, etc,,,

公式ページ等

仕様

ライブラリ

  • STL 標準テンプレートライブラリ
  • Boost 次期標準テンプレートライブラリ
  • Crypto++ 暗号関連
  • Loki Modern C++ Design 関連
  • Blitz++ Object-Oriented Scientific Computing

正規表現

memo


脳神経外科でも受診して来ようかな orz
gcc に -fsanitize=address 付けとくと address sanitizer が有効になるらしい。
$ g++ -fsanitize=address memory_leak.cpp && ./a.out
Hello, World!

=================================================================
==11538==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1024 byte(s) in 1 object(s) allocated from:
    #0 0x7f42a7d0f618 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0618)
    #1 0x55a6a261bd0b in main (/tmp/a.out+0xd0b)
    #2 0x7f42a74d6b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 1024 byte(s) leaked in 1 allocation(s).
セグったりリークしてる原因が一目瞭然。
これすごい便利じゃん。
address, thread, memory, undefined-behavior, leak と 5 つの sanitizer が使えるらしい。(memory は clang のみ?)
ネタ元:
  • University of Victoria / Department of Electrical and Computer Engineering / Michael Adams / Programming in C++ — The C++ Language, Libraries, Tools, and Other Topics # Section 7.2 Code Sanitizer
タグ

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

管理人/副管理人のみ編集できます