« Return to Thread: ALC_ENUMERATE_ALL_EXT and pluggable sound devices

Re: ALC_ENUMERATE_ALL_EXT and pluggable sound devices

by Stephen A. :: Rate this Message:

Reply to Author | View in Thread

On Fri, 2009-09-18 at 12:21 -0400, Ryan C. Gordon wrote:
> > Yes it *is* a killer, because string allocations engage the GC in
> > managed languages  (yes, there is stuff other than C/C++ that relies on
> > OpenAL). Such an approach would be completely unsuitable for such
> > environments.
>
> You only do an allocation when the device list changes in my example. If
> you can't handle that, you need a better garbage collector.  :)

1. You need an allocation whenever you cross heap boundaries (i.e. pass
an unmanaged string to a managed environment). This goes deeper than the
specific GC implementation: by definition, a GC may not touch unmanaged
memory.

2. Most modern environments work on unicode rather than ASCII, which
involves an allocation *and* a translation.

I am sorry, but using strcmp just to check a boolean flag is bad API
design (not to mention inefficient, idiomatic and unportable). It might
be me, but I really cannot see what advantage you think it confers over
a plain boolean query.

_______________________________________________
Openal-devel mailing list
Openal-devel@...
http://opensource.creative.com/mailman/listinfo/openal-devel

 « Return to Thread: ALC_ENUMERATE_ALL_EXT and pluggable sound devices