Skip to content

Instantly share code, notes, and snippets.

@satoshin2071
satoshin2071 / gist:c99400015b95060d4e63
Last active April 2, 2021 21:59
CoreFoundation入門 メモリ管理

#CoreFoundation入門 メモリ管理

##概要

CoreFoundationのルートクラス的存在であるCFTypeの中から一番使用するであろう、メモリ管理関連のメソッドを確認。

##リファレンスカウント方式のメモリ管理

CoreFoundationはObjective-Cと同様の生成/保持/解放のリファレンスカウント方式。生成したらオーナーシップを持ち、必要なくなったらオーナーシップを破棄するのが必須なのも一緒。

@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active November 8, 2025 07:48
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
wait-free/lock-free/obstruction-freeの定義について
▲全てに共通する概念
スレッドが他のスレッドの進行を禁止する事がないので、どれかのスレッドが
ロックを確保したままプリエンプションなどで全体の処理が停止する事態が発生しな
い。
これは必ずしもロックベースのアルゴリズムより高速であることを意味し
ない(現にロックの方が早い場合もある
wait-freeが一番強い条件で、それを弱める度に