2005-06-16 21:50 libumem & libutil in Solaris
商業的 Unix 都很注重利用 coredump 做 debug 的能力,畢竟商業的東西常常是不能讓你 on site 生氣亂改 source 當場測試
libumem 是 Solaris 9 提供的 userland memory managemnt library
- 整合 Debug Metadata,可以抓 Memory Leak 和 Memory Corruption
- 把之前在 kernel 裡用的嚇嚇有名的 slab allocator 拿來 userland 用, 2001 又改善一次的新版 slab allocator,在 multi-cpu,multi-thread,multi-object 的狀況下都有很好的表現,比原來 Solaris 裡的 multi-thread 版 malloc,linux glibc ptmalloc,以及當時最好的 hoard malloc 都還要好(以上指 general purpose malloc)
libuutil 是 Solaris 10 提供的 userland utility library
- include Compact C Type Format (CTF) information with each daemon,
- use
libumem(3LIB) for memory allocation, and - use standard, debuggable, MT-safe implementations of data structures.
目前已經可以在 OpenSolaris 取得 libuutil , libumem
提到常用的資料結構,應該很多人都自己 "很簡單所以自己寫" link list,xxx tree 之類的
如果不用考慮 thread 可以直接拿 ubiqx 來用
提到 OpenSolaris,CDDL (Common Development and Distribution License) 真是好物,可以拿來跟不同 license 的 static/dynamic link,像 LGPL 只能 dynamic link 不能 static link。有些 GPL zealot 說用 CDDL 版權都要給 OpenSolaris 或 Sun,這是沒看過的人在唬爛,不要被幻覺嚇倒了 :P


