Re: [Haskell-cafe] Tips for debugging seg. faults?

Thank you, Viktor! Wrt/ `withForeignPtr`, you are suggesting that I use it, not that I avoid it; correct? Wrt/ “pinned memory”, could you give me a little more explanation? Thanks, -db :)
On Jun 20, 2021, at 5:00 AM, haskell-cafe-request@haskell.org wrote:
Thus functions like `withForeignPtr` which try to make sure the the referenced memory is not released too early.
Buffer pointers should be to pinned memory, ...

On Sun, 20 Jun 2021, David Banas wrote:
Thank you, Viktor! Wrt/ `withForeignPtr`, you are suggesting that I use it, not that I avoid it; correct?
Yes, withForeignPtr should be used and unsafeForeignPtrToPtr should be avoided.

On Sun, Jun 20, 2021 at 06:54:32AM -0700, David Banas wrote:
Wrt/ `withForeignPtr`, you are suggesting that I use it, not that I avoid it; correct?
Yes, it tries to ensure that memory is not released too early.
Wrt/ “pinned memory”, could you give me a little more explanation?
I'd like to repeat my suggestion that you should post more details about your use-case. The abstract discussion may waste your time on topics that are not relevant to you. -- Viktor.

Agreed. For low level crashes any ambiguity leads to a lot of erroneous
tail chasing
On Sun, Jun 20, 2021 at 6:13 PM Viktor Dukhovni
On Sun, Jun 20, 2021 at 06:54:32AM -0700, David Banas wrote:
Wrt/ `withForeignPtr`, you are suggesting that I use it, not that I avoid it; correct?
Yes, it tries to ensure that memory is not released too early.
Wrt/ “pinned memory”, could you give me a little more explanation?
I'd like to repeat my suggestion that you should post more details about your use-case. The abstract discussion may waste your time on topics that are not relevant to you.
-- Viktor. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (4)
-
Carter Schonwald
-
David Banas
-
Henning Thielemann
-
Viktor Dukhovni