cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake https://pypy.org | IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end and https://libera.irclog.whitequark.org/pypy | the pypy angle is to shrug and copy the implementation of CPython as closely as possible, and staying out of design decisions
[Arfrever] has quit [Ping timeout: 260 seconds]
[Arfrever] has joined #pypy
itamarst has quit [Quit: Connection closed for inactivity]
jcea has quit [Ping timeout: 246 seconds]
<korvo> Ugh, I need sleep. I thought I got ALSA bindings working, it was finally all compiling... and then I got a segfault. Worse, it's in ALSA, not my code. But I think it's to do with how I wrote the binding.
<korvo> ALSA has opaque typedefs like `typedef struct _snd_seq snd_seq_t;` The idea is that users only ever have snd_seq_t* pointers. I couldn't get rffi_platform.Struct() to work, but I can do rffi.COpaquePtr().
<korvo> However, snd_seq_open()'s first argument is of snd_seq_t**. For reasons I don't understand, the return pointer is passed via out-param. I can't do lltype.Ptr(rffi.COpaquePtr()); it's apparently not legal.
<korvo> Cribbing around PyPy, I found folks using lltype.FixedSizeArray(rffi.COpaquePtr(), 1), which sounds reasonable to me. But it apparently doesn't work.
<korvo> Here's the relevant code: https://bpa.st/P4B2E6NFYFVWRZJXBJV2YE6ETI The segfault's in snd_seq_open(), presumably when ALSA's code tries to access my ptr.
itamarst has joined #pypy
jcea has joined #pypy
jcea has quit [Ping timeout: 246 seconds]
<korvo> FFI's got me feeling like I could break a keyboard across a payday loan officer's face. I don't like that if I can't find some example of PyPy using rffi to do something, then rffi might as well not be able to do it.
<korvo> I recognize that this isn't y'all's fault.
<korvo> Alright, I give up. I'm going to make a note for myself that alloca-oriented libraries like ALSA aren't compatible with rffi, and go find something else. Sorry for the noise.
glyph has quit [Remote host closed the connection]
glyph has joined #pypy
jcea has joined #pypy