[0.2.x] fixed : cistom type padding

git-svn-id: https://pykd.svn.codeplex.com/svn@87171 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2014-01-27 14:18:56 +00:00 committed by Mikhail I. Izmestev
parent 222515e191
commit 64501a6598
2 changed files with 13 additions and 8 deletions

View File

@ -23,9 +23,20 @@ TypeInfoPtr TypeBuilder::createUnion( const std::string &name, ULONG align )
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
CustomBase::CustomBase( const std::string &name, ULONG pointerSize, ULONG align ) :
UdtTypeInfoBase( name )
{
m_ptrSize = pointerSize;
m_align = align ? align : m_ptrSize;
m_size = 0;
}
////////////////////////////////////////////////////////////////////////////////
ULONG CustomBase::getSize() ULONG CustomBase::getSize()
{ {
return alignUp( m_size, getAlignReq() ); const ULONG alignReq = getAlignReq();
return alignUp( m_size, alignReq < m_align ? alignReq : m_align );
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -59,13 +59,7 @@ public:
protected: protected:
CustomBase( const std::string &name, ULONG pointerSize, ULONG align ) : CustomBase( const std::string &name, ULONG pointerSize, ULONG align );
UdtTypeInfoBase( name )
{
m_ptrSize = pointerSize;
m_align = align ? align : m_ptrSize;
m_size = 0;
}
static ULONG alignUp(ULONG val, ULONG align); static ULONG alignUp(ULONG val, ULONG align);