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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [boehm-gc/] [gc_cpp.cc] - Diff between revs 721 and 783

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 721 Rev 783
/*************************************************************************
/*************************************************************************
Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
 
 
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
 
 
    Last modified on Sat Nov 19 19:31:14 PST 1994 by ellis
    Last modified on Sat Nov 19 19:31:14 PST 1994 by ellis
                  on Sat Jun  8 15:10:00 PST 1994 by boehm
                  on Sat Jun  8 15:10:00 PST 1994 by boehm
 
 
Permission is hereby granted to copy this code for any purpose,
Permission is hereby granted to copy this code for any purpose,
provided the above notices are retained on all copies.
provided the above notices are retained on all copies.
 
 
This implementation module for gc_c++.h provides an implementation of
This implementation module for gc_c++.h provides an implementation of
the global operators "new" and "delete" that calls the Boehm
the global operators "new" and "delete" that calls the Boehm
allocator.  All objects allocated by this implementation will be
allocator.  All objects allocated by this implementation will be
non-collectable but part of the root set of the collector.
non-collectable but part of the root set of the collector.
 
 
You should ensure (using implementation-dependent techniques) that the
You should ensure (using implementation-dependent techniques) that the
linker finds this module before the library that defines the default
linker finds this module before the library that defines the default
built-in "new" and "delete".
built-in "new" and "delete".
 
 
Authors: John R. Ellis and Jesse Hull
Authors: John R. Ellis and Jesse Hull
 
 
**************************************************************************/
**************************************************************************/
/* Boehm, December 20, 1994 7:26 pm PST */
/* Boehm, December 20, 1994 7:26 pm PST */
 
 
#include "gc_cpp.h"
#include "gc_cpp.h"
 
 
void* operator new( size_t size ) {
void* operator new( size_t size ) {
    return GC_MALLOC_UNCOLLECTABLE( size );}
    return GC_MALLOC_UNCOLLECTABLE( size );}
 
 
void operator delete( void* obj ) {
void operator delete( void* obj ) {
    GC_FREE( obj );}
    GC_FREE( obj );}
 
 
#ifdef GC_OPERATOR_NEW_ARRAY
#ifdef GC_OPERATOR_NEW_ARRAY
 
 
void* operator new[]( size_t size ) {
void* operator new[]( size_t size ) {
    return GC_MALLOC_UNCOLLECTABLE( size );}
    return GC_MALLOC_UNCOLLECTABLE( size );}
 
 
void operator delete[]( void* obj ) {
void operator delete[]( void* obj ) {
    GC_FREE( obj );}
    GC_FREE( obj );}
 
 
#endif /* GC_OPERATOR_NEW_ARRAY */
#endif /* GC_OPERATOR_NEW_ARRAY */
 
 
#ifdef _MSC_VER
#ifdef _MSC_VER
 
 
// This new operator is used by VC++ in case of Debug builds !
// This new operator is used by VC++ in case of Debug builds !
void* operator new( size_t size,
void* operator new( size_t size,
                          int ,//nBlockUse,
                          int ,//nBlockUse,
                          const char * szFileName,
                          const char * szFileName,
                          int nLine )
                          int nLine )
{
{
#ifndef GC_DEBUG
#ifndef GC_DEBUG
        return GC_malloc_uncollectable( size );
        return GC_malloc_uncollectable( size );
#else
#else
        return GC_debug_malloc_uncollectable(size, szFileName, nLine);
        return GC_debug_malloc_uncollectable(size, szFileName, nLine);
#endif
#endif
}
}
 
 
#endif /* _MSC_VER */
#endif /* _MSC_VER */
 
 
 
 

powered by: WebSVN 2.1.0

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