Version française
Home     About     Download     Resources     Contact us    
Browse thread
Bigarrays and blocking_section..
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitry Bely <dmitry.bely@g...>
Subject: Re: [Caml-list] Bigarrays and blocking_section..
On Tue, May 25, 2010 at 8:25 PM, Romain Beauxis <toots@rastageeks.org> wrote:
>        Hi all !
>
> I am trying to understand some segfault that we observe and I have a question
> about the relationships between bigarrays in C and the Gc.
>
> We have the following code:
>
> static frame *frame_of_value(value v, frame *f)
> {
>  f->data = Caml_ba_data_val(Field(v,0));
>  f->width = Int_val(Field(v,1));
>  f->height = Int_val(Field(v,2));
>  f->stride = Int_val(Field(v,3));
>
>  return f;
> }

Are you sure that you correctly calculate the bigarray size in your
Caml code? Why not just use struct caml_ba_array fields? I suspect
it's not GC problem but just a buffer overrun in memset().

- Dmitry Bely