1
/* Copyright (C) 2004 Garrett A. Kajmowicz
3
This file is part of the uClibc++ Library.
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
extern "C" void *__cxa_allocate_exception(size_t thrown_size){
26
/*The amount of data needed is the size of the object *PLUS*
27
the size of the header. The header is of struct __cxa_exception
28
The address needs to be adjusted because the pointer we return
29
should not point to the start of the memory, but to the point
30
where the object being thrown actually starts*/
32
retval = malloc(thrown_size + sizeof(__cxa_exception));
34
// Check to see that we actuall allocated memory
39
//Need to do a typecast to char* otherwize we are doing math with
40
//a void* which makes the compiler cranky (Like me)
41
return ((char *)retval + sizeof(__cxa_exception));
44
extern "C" void __cxa_free_exception(void *thrown_exception){
50
extern "C" void __cxa_throw (void *thrown_exception, std::type_info *tinfo,void (*dest) (void *) ){