home *** CD-ROM | disk | FTP | other *** search
- // $Id: MemCheckD.h,v 1.8 1998/03/25 12:43:45 zeller Exp $ -*- C++ -*-
- // MemCheck operator definitions
-
- // Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
- // Written by Andreas Zeller <zeller@ips.cs.tu-bs.de>.
- //
- // This file is part of the ICE Library.
- //
- // The ICE Library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- //
- // The ICE Library is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- // See the GNU Library General Public License for more details.
- //
- // You should have received a copy of the GNU Library General Public
- // License along with the ICE Library -- see the file COPYING.LIB.
- // If not, write to the Free Software Foundation, Inc.,
- // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- //
- // ICE is the incremental configuration environment.
- // For details, see the ICE World-Wide-Web page,
- // `http://www.cs.tu-bs.de/softech/ice/',
- // or send a mail to the ICE developers <ice@ips.cs.tu-bs.de>.
-
- // Usage:
- // Include this file in your main module (or in a single module which is
- // linked with your program). All allocation and deallocation
- // will then go through the MemCheck class functions.
-
- char MemCheckDef_rcsid[] =
- "$Id: MemCheckD.h,v 1.8 1998/03/25 12:43:45 zeller Exp $";
-
- #include "MemCheck.h"
-
- #include "config.h"
- #include <sys/types.h>
-
- // Std new/delete ops - will be called for C++ non-array free store operation
- void *operator new(size_t nbytes)
- {
- return MemCheck::alloc(nbytes);
- }
-
- void operator delete(void *p)
- #if HAVE_EXCEPTIONS
- throw()
- #endif
- {
- MemCheck::free(p);
- }
-
- #if HAVE_ARRAY_OPERATOR_NEW
- // Array new/delete ops - will be called for C++ array free store operations
- void *operator new[](size_t nbytes)
- {
- return MemCheck::alloc(nbytes);
- }
-
- void operator delete[](void *p)
- #if HAVE_EXCEPTIONS
- throw()
- #endif
- {
- MemCheck::free(p);
- }
- #endif // HAVE_ARRAY_OPERATOR_NEW
-