~/talk

Avoiding Pitfalls in C Extensions

Talkat RubyConf 2007 · 2007-11-02..11-04· [ruby]
slides:none on file

Shows how C/C++ extensions actually fail and how to fix them: missing frees and ownership bugs with JIT values, unchecked libjit return codes, deadlocks from unlocked build contexts, and C++ exceptions escaping into Ruby. Builds a working postfix four‑function JIT using libjit (it compiles and runs), demonstrates marshaling pitfalls and the allocate/initialize fix, wraps boost::shared_ptr safely, offers Rice as a higher‑level C++ binding and recommends valgrind suppressions for leak hunting.

AI-written summary · about

  1. 0:00Start
  2. 9:51Creating a Function
  3. 10:40Data Abstract Macro
  4. 16:42Unit Test
  5. 17:50Rewrite the Library
  6. 22:21Four Function Calculator
  7. 25:37Header File
  8. 39:14Arrays
  9. 39:42Assignment Operator
  10. 41:36Final Thoughts
  11. 42:05Object Ownership
  12. 42:51Suggestions for Avoiding the Inevitable Memory Leaks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.