mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 12:23:29 +00:00
Synchronize with trunk.
svn path=/branches/ntvdm/; revision=59499
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* PROJECT: ReactOS c++ runtime library
|
||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
||||
* PURPOSE: Exception-handling vector ctor/dtor iterator implementation
|
||||
* PROGRAMMER: Thomas Faber ([email protected])
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void __stdcall MSVCRTEX_eh_vector_constructor_iterator(void *pMem, size_t sizeOfItem, int nItems, void (__thiscall *ctor)(void *), void (__thiscall *dtor)(void *))
|
||||
{
|
||||
char *pEnd = static_cast<char *>(pMem) + nItems * sizeOfItem;
|
||||
for (char *pItem = static_cast<char *>(pMem);
|
||||
pItem < pEnd;
|
||||
pItem += sizeOfItem)
|
||||
{
|
||||
try
|
||||
{
|
||||
ctor(pItem);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
for (pItem -= sizeOfItem; pItem >= pMem; pItem -= sizeOfItem)
|
||||
dtor(pItem);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __stdcall MSVCRTEX_eh_vector_destructor_iterator(void *pMem, size_t sizeOfItem, int nItems, void (__thiscall *dtor)(void *))
|
||||
{
|
||||
char *pEnd = static_cast<char *>(pMem) + nItems * sizeOfItem;
|
||||
for (char *pItem = pEnd - sizeOfItem;
|
||||
pItem >= pMem;
|
||||
pItem -= sizeOfItem)
|
||||
{
|
||||
try
|
||||
{
|
||||
dtor(pItem);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
for (pItem -= sizeOfItem; pItem >= pMem; pItem -= sizeOfItem)
|
||||
dtor(pItem);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user