Skip to content

Commit

Permalink
Merge pull request #55 from alexmarkley/48-segfault
Browse files Browse the repository at this point in the history
Fix rare SIGSEGV when transferring large replicas.
  • Loading branch information
bcpierce00 committed Dec 24, 2016
2 parents 1832284 + c1ddff1 commit d860a69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bytearray_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "caml/intext.h"
#include "caml/bigarray.h"
#include "caml/memory.h"

CAMLprim value ml_marshal_to_bigarray(value v, value flags)
{
Expand All @@ -21,9 +22,12 @@ CAMLprim value ml_marshal_to_bigarray(value v, value flags)

CAMLprim value ml_unmarshal_from_bigarray(value b, value ofs)
{
CAMLparam1(b); /* Holds [b] live until unmarshalling completes. */
value result;
struct caml_bigarray *b_arr = Bigarray_val(b);
return input_value_from_block (Array_data (b_arr, ofs),
result = input_value_from_block (Array_data (b_arr, ofs),
b_arr->dim[0] - Long_val(ofs));
CAMLreturn(result);
}

CAMLprim value ml_blit_string_to_bigarray
Expand Down

0 comments on commit d860a69

Please sign in to comment.