Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
a8981c6f
Commit
a8981c6f
authored
12 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
removes mem_debug
parent
d02405d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/stuff/common/mem_debug.hh
+1
-96
1 addition, 96 deletions
dune/stuff/common/mem_debug.hh
with
1 addition
and
96 deletions
dune/stuff/common/mem_debug.hh
+
1
−
96
View file @
a8981c6f
#include
<cstdlib>
#include
<iostream>
#include
<string>
/** super fun file indeed (read: include at your own risk)
*
*/
#warning "Rene should take a look at this!"
#if 0
// #define new(a, rest...) mynew( a, atoi(__LINE__), __FILE__, rest )
// void * mynew( size_t sz, int line, char* file) throw (std::bad_alloc)
void* mynew(size_t sz) throw (std::bad_alloc){
// std::cerr << "node::new" << std::endl;
return malloc(sz);
}
// #define new(...) mynew(...)
// void* mynew[](std::size_t) throw (std::bad_alloc);
// void* mynew(std::size_t, const std::nothrow_t&) throw();
// void* mynew[](std::size_t, const std::nothrow_t&) throw();
// void operator delete(void*, const std::nothrow_t&) throw();
// void operator delete[](void*, const std::nothrow_t&) throw();
//
// void operator delete( void *pvMem )
// {
// free( pvMem );
// }
void* operator new(unsigned long size, const char* file) {
std::cout << file << " operator new(" << size << "):\t";
void* p = malloc(size);
if (!p)
throw "operator new() error";
std::cout << static_cast< void* >(p) << std::endl;
return p;
} // new
void* operator new[](unsigned long size, const char* file) {
std::cout << file << " operator new(" << size << "):\t";
void* p = malloc(size);
if (!p)
throw "operator new() error";
// std::cout << static_cast<void*>(p) << std::endl;
return p;
} // new[]
void operator delete(void* p) throw () {
// std::cout << "operator delete(" << p << ")" << std::endl;
free(p);
}
void operator delete[](void* p) throw () {
// std::cout << "operator delete[](" << p << ")" << std::endl;
free(p);
}
#define new (a) new (a, __func__)
#endif
/** Copyright (c) 2012, Rene Milk
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those
* of the authors and should not be interpreted as representing official policies,
* either expressed or implied, of the FreeBSD Project.
**/
#error "use something sane, like http://duma.sourceforge.net/ or valgrind"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment