[asterisk-bugs] [Asterisk 0012932]: [patch] Union rather than cast for outbuf (translate.h)

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Jul 3 13:42:03 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12932 
====================================================================== 
Reported By:                snuffy
Assigned To:                kpfleming
====================================================================== 
Project:                    Asterisk
Issue ID:                   12932
Category:                   Core/Portability
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 124869 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             06-26-2008 10:28 CDT
Last Modified:              07-03-2008 13:42 CDT
====================================================================== 
Summary:                    [patch] Union rather than cast for outbuf
(translate.h)
Description: 
This is part of the things i tried to achieve under solaris to fix
alginment issues. ( issue http://bugs.digium.com/view.php?id=11485 )

This has only had very basic tests done.. alaw/ulaw to gsm etc.
Playback seemed fine.

Probably want to rename some of the unions var names but its a start
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0011485 Alignment issues building on solaris sparc
====================================================================== 

---------------------------------------------------------------------- 
 kpfleming - 07-03-08 13:42  
---------------------------------------------------------------------- 
First, let me say that in fact I would like to fix all the alignment
problems that are found on SPARC platforms; there is no reason why we
shouldn't be portable to platforms that don't handle unaligned accesses
transparently (but slowly) like x86 systems do. For that work, yes, we'll
use issue 11485.

However, let's get this one solved first, because it will determine the
method we'll use to solve the others in most cases. The first version of
the 'aligner' branch, which you reported 'does work', could only have
compiled... it had very serious problems and couldn't actually have worked
to process calls that required transcoding unless you were very, very lucky
:-) I later fixed that branch, but I wasn't happy with that solution.

I have now created a new branch, /team/kpfleming/aligner2. This branch is
based on 1.4, not trunk, because I want to fix these issues there first
then get them fixed for trunk and 1.6.0 as well. This branch contains a new
method of allocating the runtime structure in translate.c, that lets the
compiler take care of most of the work, and ensures that we have actually
properly aligned each element of the structure, even though we don't know
for sure what the structure elements (and their sizes) will be until each
time newpvt() gets called.

If you can, I'd very much appreciate some live call testing of this
branch, so that we can confirm that this method works as it should. If it
does, I'll port these fixes to trunk and 1.6.0, then close this bug and
we'll move on to 11485 and try to get the rest of them taken care of. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-03-08 13:42  kpfleming      Note Added: 0089697                          
======================================================================




More information about the asterisk-bugs mailing list