473,416 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

_CrtDumpMemoryLeaks and <valarray>

Hi,

I want to track memory leaks in my application (that is using <valarray>).
I used the following code:
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

But then, when I include <valarray> the compiler raises the following errors :

c:\[...].NET 2003\Vc7\include\valarray(367) : warning C4003: not enough
actual parameters for macro 'free'
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(427) : see reference to class
template instantiation 'std::valarray<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1124) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=size_t
]
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1333) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=std::_Bool
]
c:\[...].NET 2003\Vc7\include\valarray(1335) : see reference to
class template instantiation 'std::mask_array<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\DEV\mySoft\src\converTools\converTypes.h(85) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=double
]

It appeared with use of _CRTDBG_MAP_ALLOC macro and I think it leads to a
replacement of the free member-function in std::valarray class by the
debug-purpose defined free macro.

But I can't see how I should use those two elements correctly

Thanks

Dack
Nov 17 '05 #1
1 2546
Dack wrote:
Hi,

I want to track memory leaks in my application (that is using <valarray>).
I used the following code:
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

But then, when I include <valarray> the compiler raises the following errors :

c:\[...].NET 2003\Vc7\include\valarray(367) : warning C4003: not enough
actual parameters for macro 'free'
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(427) : see reference to class
template instantiation 'std::valarray<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1124) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=size_t
]
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\[...].NET 2003\Vc7\include\valarray(1333) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=std::_Bool
]
c:\[...].NET 2003\Vc7\include\valarray(1335) : see reference to
class template instantiation 'std::mask_array<_Ty>' being compiled
c:\[...].NET 2003\Vc7\include\valarray(367) : error C2059: syntax error : ','
c:\DEV\mySoft\src\converTools\converTypes.h(85) : see reference to
class template instantiation 'std::valarray<_Ty>' being compiled
with
[
_Ty=double
]

It appeared with use of _CRTDBG_MAP_ALLOC macro and I think it leads to a
replacement of the free member-function in std::valarray class by the
debug-purpose defined free macro.

But I can't see how I should use those two elements correctly


#include <valarray> before the other stuff.

Tom
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jim West | last post by:
The GNU implementation of the valarray header (g++ version 3.3.2) includes the comment: // This complication is so to make valarray<valarray<T> > work // even though it is not required by the...
11
by: Charles L | last post by:
I have read that the inclusion of <fstream.h> makes the inclusion of <iostream.h> unnecessary. Is this correct? Charles L
1
by: Busin | last post by:
How to save a valarray<bool> object in a file and how to read it back into a valarray<bool> object? Thanks!
2
by: Steven T. Hatton | last post by:
I believe the answer is that the language doesn't support the ability to retain a reference to a std::indirect_array<>, and would be illadvised to try, but I figure I'll ask just to be sure. What...
43
by: john | last post by:
Hi, in TC++PL 3 on pages 674-675 it is mentioned: "Maybe your first idea for a two-dimensional vector was something like this: class Matrix { valarray< valarray<doublev; public: // ... };
1
by: Alex Vinokur | last post by:
Is it possible to add an element to valarray<T>? Is there something like push_back() for valarray<T>? Alex Vinokur email: alex DOT vinokur AT gmail DOT com...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.