guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: segmenation fault


From: Catonano
Subject: Re: segmenation fault
Date: Mon, 12 Jun 2017 00:09:36 +0200

2017-06-11 22:56 GMT+02:00 Catonano <address@hidden>:

> Amirouche, Thomas,
>
>
> 2017-06-09 10:00 GMT+02:00 Amirouche Boubekki <
> address@hidden>:
>
>>  It's something like (bytevector->pointer (make-vector)) there is a
>> make-double-pointer procedure in guile git
>>
>
> I have overlooked both your remarks and Thomas's remarks
>
> I apologize, I was not understanding the issue correctly
>
> I have found define-wrapped-pointer-type in the manual only now and of
> course both of you are right.
>
> The case described in the manual is slightly different than the one freexl
> poses
>
> I can't wrap a pointer created by the C funtion. I have to pass one
> created in scheme land
>
> The make-double-pointer  procedure in guile-git seems appropriate. Thanks,
> Amirouche
>


Ok, I finally managed to make it work !

Amirouche, I didn't remember but I had written a line exactly equal to
yours:
(bytevector->pointer (make-bytevector (sizeof '*)))

in order to create e void pointer in scheme land !

The thing is that when I passed it in as an argument it was a void pointer:
void *

but when freexl_open had run it was a double pointer: handler **

Subsequent functions expected a simple pointer: handler *

So it simply had to be dereferenced ! Like this

(dereference-pointer handler **double-pointer)

this returns a handler *single-pointer

It's impossible discussing pointer types without becoming psychedelic in a
few lines ! :-/

Now, to make thing really tidy, I should also use the wrap unwrap mechanism

Thank you all people !


reply via email to

[Prev in Thread] Current Thread [Next in Thread]