- Alarm Clock
- 在 Solaris 下,有時會出現 "ALARM CLOCK",然後中斷。
- 有可能是 usleep() 等造成的? 不太確定。
- 方法:略去 SIGALRM 的 signal.
- signal(SIGALRM, SIG_IGN);
- 在 DLL 內實作 template class 有煩人的 explicit instantiation 的問題...
- 參考這裡
- 另一篇有關 Template 實作的文章: 這裡
,有一段 the "traditional" way of organizing source code (declarations in *.h files, and definitions in *.cpp files) does not work with templates,所以,我看到的 template 實作似乎都是整個放在 .h 。
- 結論在 DLL 內實作 template class 有點煩人。
- 少用 strdup,用 new/delete
- 這樣常常會有問題 (不知為什麼?)
- string pSrc;
- strdup(pTarget, pSrc.c_str());
- free(pTarget);
- 改用這樣就沒問題
- string pSrc;
- pTarget = new char[pSrc.length()+1];
- delete []pTarget;
相關文章
| 程式筆記 |
RSS 2.0 Feed |
Trackback |