#8694 closed patch (wontfix)
Minor tweak to rate.cpp
Reported by: | SF/robinwatts | Owned by: | fingolfin |
---|---|---|---|
Priority: | normal | Component: | Audio |
Version: | Keywords: | ||
Cc: | Game: |
Description
Fingolfin points out that some compilers are crap at optimising array accesses due to pointer aliasing.
This patch therefore avoids using the 2 place arrays, and instead uses 2 normal variables.
This produces larger source, but any decent compiler should only keep one side of the if when it does the template instantiation, so will work out better overall.
Ticket imported from: #1738426. Ticket imported from: patches/799.
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | SoundRateTweak added |
---|
comment:1 by , 17 years ago
Thanks for this, but I just commited an alternate patch which also resolves this "issue", but in an (IMHO) slightly more elegant fashion: I really liked your out[reverseStereo ^ 1] trick, as it avoids duplicating code inside an if/else construct, and even a bad optimizer should be able to deal with this efficiently. So I was loathe to let go of this neat technique.
Hence, what I did was to use this indexing on obuf instead (were we can't avoid writing to a pointer anyway). Best of both worlds, so to speak :-)
comment:2 by , 17 years ago
Owner: | set to |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
comment:3 by , 6 years ago
Component: | → Audio |
---|
Small tweak to rate.cpp