Skip to content
Snippets Groups Projects
Commit 73a1b6e6 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

in DeleteItem(): if offset!=0 need to align address using:

   addr += sizeof(void*)-offset


git-svn-id: http://root.cern.ch/svn/root/trunk@10443 27541ba8-7e3a-0410-8455-c3a389f83636
parent dccee34c
Branches
Tags
No related merge requests found
// @(#)root/cont:$Name: $:$Id: TGenCollectionProxy.cxx,v 1.3 2004/11/01 07:20:18 brun Exp $
// @(#)root/cont:$Name: $:$Id: TGenCollectionProxy.cxx,v 1.4 2004/11/01 08:52:13 brun Exp $
// Author: Markus Frank 28/10/04
/*************************************************************************
......@@ -700,8 +700,9 @@ void TGenCollectionProxy::DeleteItem(bool force, void* ptr) const {
char *addr = ((char*)ptr)+fKey->fSize;
//make sure the value address is aligned on a word boundary
long laddr = (long)addr;
int offset = laddr % sizeof(void*);
addr += offset;
int offset;
if ((offset = laddr % sizeof(void*)))
addr += sizeof(void*)-offset;
if (*(void**)addr) (*fVal->fDelete)(*(void**)addr);
}
// (*fValue->fDtor)(ptr); No: pair must stay intact !
......
// @(#)root/cont:$Name: $:$Id: TGenCollectionProxy.cxx,v 1.3 2004/11/01 07:20:18 brun Exp $
// @(#)root/cont:$Name: $:$Id: TGenCollectionProxy.cxx,v 1.4 2004/11/01 08:52:13 brun Exp $
// Author: Markus Frank 28/10/04
/*************************************************************************
......@@ -700,8 +700,9 @@ void TGenCollectionProxy::DeleteItem(bool force, void* ptr) const {
char *addr = ((char*)ptr)+fKey->fSize;
//make sure the value address is aligned on a word boundary
long laddr = (long)addr;
int offset = laddr % sizeof(void*);
addr += offset;
int offset;
if ((offset = laddr % sizeof(void*)))
addr += sizeof(void*)-offset;
if (*(void**)addr) (*fVal->fDelete)(*(void**)addr);
}
// (*fValue->fDtor)(ptr); No: pair must stay intact !
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment