OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [infra/] [current/] [src/] [delete.cxx] - Blame information for rev 838

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      common/delete.cxx
4
//
5
//      Default delete implementation
6
//
7
//==========================================================================
8
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
9
// -------------------------------------------                              
10
// This file is part of eCos, the Embedded Configurable Operating System.   
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under    
14
// the terms of the GNU General Public License as published by the Free     
15
// Software Foundation; either version 2 or (at your option) any later      
16
// version.                                                                 
17
//
18
// eCos is distributed in the hope that it will be useful, but WITHOUT      
19
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
20
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
21
// for more details.                                                        
22
//
23
// You should have received a copy of the GNU General Public License        
24
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
25
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
26
//
27
// As a special exception, if other files instantiate templates or use      
28
// macros or inline functions from this file, or you compile this file      
29
// and link it with other works to produce a work based on this file,       
30
// this file does not by itself cause the resulting work to be covered by   
31
// the GNU General Public License. However the source code for this file    
32
// must still be made available in accordance with section (3) of the GNU   
33
// General Public License v2.                                               
34
//
35
// This exception does not invalidate any other reasons why a work based    
36
// on this file might be covered by the GNU General Public License.         
37
// -------------------------------------------                              
38
// ####ECOSGPLCOPYRIGHTEND####                                              
39
//==========================================================================
40
//#####DESCRIPTIONBEGIN####
41
//
42
// Author(s):   jlarmour
43
// Contributors:  jlarmour
44
// Date:        1999-08-13
45
// Purpose:     Gives a default delete operation if the C library isn't present
46
// Description: This file supplies a definition of the default delete
47
//              operation (aka __builtin_delete and __builtin_vec_delete)
48
//              for use when the normal delete can't be used - normally when
49
//              the C library is not present
50
//
51
//####DESCRIPTIONEND####
52
//
53
//==========================================================================
54
 
55
#include <pkgconf/system.h>
56
#include <pkgconf/infra.h>
57
 
58
#include <cyg/infra/cyg_type.h>
59
#include <cyg/infra/cyg_ass.h>
60
 
61
// see the description comment in infra.cdl for
62
// CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
63
 
64
#ifdef CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
65
// then define these empty functions:
66
 
67
#ifdef CYGPKG_INFRA_DEBUG
68
static cyg_uint32 counter;
69
#endif
70
 
71
void operator delete(void *x) throw()
72
{
73
#ifndef CYGPKG_INFRA_DEBUG  
74
    CYG_EMPTY_STATEMENT;
75
#else
76
    counter++;
77
    CYG_ASSERT(counter < CYGNUM_INFRA_EMPTY_DELETE_THRESHOLD,
78
               "Do you want an empty delete function?");
79
#endif
80
}
81
 
82
void operator delete[](void *x) throw()
83
{
84
#ifndef CYGPKG_INFRA_DEBUG  
85
    CYG_EMPTY_STATEMENT;
86
#else
87
    counter++;
88
    CYG_ASSERT(counter < CYGNUM_INFRA_EMPTY_DELETE_THRESHOLD,
89
               "Do you want an empty delete function?");
90
#endif
91
}
92
 
93
#endif // CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS
94
 
95
// EOF delete.cxx

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.