chadaustin / buffer-builder

Haskell library for efficiently building up buffers
BSD 3-Clause "New" or "Revised" License
26 stars 8 forks source link

handle malloc() failure #4

Closed chadaustin closed 9 years ago

chadaustin commented 9 years ago

Plan:

Have an internal 'dead' bit in BufferWriter

bw_new return 0 on failure, checked on Haskell side bw_append functions don't fail, they just mark as dead on allocation failure bw_get_and_trim returns failure code, Haskell throws memory error if dead