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 6912375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:05:02+00:00 2026-05-27T09:05:02+00:00

The dynamic memory allocation operators – new and delete can be overridden for a

  • 0

The dynamic memory allocation operators – new and delete can be overridden for a specific class. I could define a different memory allocation scheme than the default that is provided by the C++ Run-time on windows. I have few questions related to it:

  1. Is overriding new and delete operator for a specific class portable such that it also works on unix? Is it part of the C++ standard?

  2. What are the cases that might require you to override memory allocation operators for a specific class? Only case that I could think of is – tracking memory allocations for leaks.

  • 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-27T09:05:03+00:00Added an answer on May 27, 2026 at 9:05 am

    Yes, it is portable, but beware that MS compilers handle the ‘nothrow’ part of it different than the ANSI standard – got burned on that.

    As to why, yes track memory, tracking leaks, tracking allocations are all nice, but those can be done globally. You could overrride new/delete for something like VRAM allocations, but I usually see that sort of thing called out in different functions. The biggest reason to override new/delete is if you have a better understanding of how your memory system is going to be used, and can tailor your functions more efficiently than the nice, but generic versions of new/delete supplied by your vendor. Small object allocation comes to mind as something that is quite often overlooked or poorly implemented, along with just how much info you want to pass around with allocations for debug purposes.

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

Sidebar

Related Questions

What is the time complexity of dynamic memory allocation using new, malloc, etc.? I
I am now starting Dynamic Memory Allocation in class and have a ok understanding
Does doing something like this use dynamic memory allocation? template <class T, int _size>
Looks like dynamic memory allocation without garbage collection is a way to disaster. Dangling
I am learning C++. I am trying to learn this dynamic memory allocation. In
Hey all. I'm doing a linked list exercise that involves dynamic memory allocation, pointers,
Dynamic allocations with new/delete are said to take place on the free-store , while
I have questions regarding stacks and dynamic memory allocation. 1) Does kernel determine the
I'm looking for some good code examples of dynamic memory allocation using an assembly
I'm playing with dynamic memory allocation by hand and I wanted to see how

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.