[pulseaudio-discuss] question: is the mainloop api vtable mutable?

jnqnfe at gmail.com jnqnfe at gmail.com
Thu Jun 28 16:41:41 UTC 2018


On Mon, 2018-06-25 at 18:57 +0300, Tanu Kaskinen wrote:
> On Sat, 2018-06-16 at 20:01 +0100, jnqnfe at gmail.com wrote:
> > Is it intended that the mainloop API vtable be mutable, allowing
> > users
> > to hijack it with their own (proxy) methods, or should it and the
> > 'get_api' functions really be constified?
> > 
> > I held off on constifying this thus far (in both patching PA itself
> > and
> > in my Rust bindings) because I really wasn't sure what the
> > intention
> > was...
> > 
> > With my latest work tidying things up in v2.x of the binding (just
> > released), and with needing to now look to whether `Futures` is
> > something to implement (with which I need to understand how future
> > execution would couple with the mainloop), I really need to know
> > this
> > now...
> 
> The vtable isn't meant to be mutable, but pa_mainloop_get_api() can't
> be changed to return a const pointer, because that will break
> applications that assign the result to a non-const variable. Only
> function arguments can be constified, not function return values.

Ok, right yes. I had to rush that email out and did not think that bit
through.

I've just sent in a load of patches relating to it in a separate email.
I meant to reply to this previously but an update broke my mail client
briefly :/

Thanks :)


More information about the pulseaudio-discuss mailing list