Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7026409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:06:49+00:00 2026-05-28T00:06:49+00:00

In my current project I use my own custom allocators inspired by the article

  • 0

In my current project I use my own custom allocators inspired by the article on BitSquid. I also replace new and malloc to help me track down where they are used (as this should be minimised – currently not called anywhere.)

I’ve read that many of the more mature C++ test frameworks (CppUTest for example) rely on their own new/malloc overloads. Are there any out there that don’t? My project is cross-platform (Windows, Linux, Mac and mobiles) if that helps.

(Edit: Initially forgot to mention that we don’t use Boost)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:06:49+00:00Added an answer on May 28, 2026 at 12:06 am

    Boost Tests for example does not base itself on his own new/malloc overloads, I actually use BOOST TESTS and I have created new/malloc overloads to see where (line and file) memory leek happens.

    BOOST is cross platform but since I do all my development on windows I used some prexistent overloads of malloc-like functions (crtdbg.h) and just overloaded the new operator. If you need your tests to be cross platform you can overload the mallocs manually.

    the code below is the content of a .h file that is the last included file of every .cpp file.

    #ifdef _DEBUG
    
    #define _CRTDBG_MAP_ALLOC
    #include <stdlib.h>
    #include <crtdbg.h>
    
    #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
    #define new DEBUG_NEW
    
    #endif
    

    I used this approach because some parts of boost (not the testing part) overload the new operator and I also have another library that internaly overloads the new operator so by including this at the end of the includes list I am sure that I do not mess with the internals of my libraries.

    http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/index.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our current project at work is a new MVC web site that will use
In my current project, we use lots of user controls. Large user controls (500+
I am looking to use an IOC container in my current project which is
I'm making pretty heavy use of reflection in my current project to greatly simplify
I am interested in applying dependency injection to my current project, which makes use
I'm trying to convert a current Django project in development to use zc.buildout So
We are trying to use the MVP pattern in our current project (asp.net app)
For my current project, we use a nHibernate session to retrieve the object, and
In my current project I have to decide which technique to use when branching.
In the current project I would like to create my own hash function but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.