- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good afternoon.
I am beginner in TBB. Can You prompting why Parallel Inspector shows memory leak in a following example?
I am beginner in TBB. Can You prompting why Parallel Inspector shows memory leak in a following example?
[bash]#includeErrors (level mi4):
#include
#include
class SimpleSum
{
float* my_a;
public:
float sum;
void operator( )( const tbb::blocked_range& r )
{
float *a = my_a;
for( size_t i=r.begin(); i!=r.end( ); ++i )
sum += a;
}
SimpleSum( SimpleSum& x, tbb::split ) : my_a(x.my_a), sum(0) {}
void join( const SimpleSum& y )
{
sum += y.sum;
}
SimpleSum(float a[] ) :
my_a (a),
sum (0)
{
}
};
int _tmain(int argc, _TCHAR* argv[])
{
UINT Size = 1000;
float* Mass = (float*) _aligned_malloc(Size * sizeof(float), 16 );
for (UINT i = 0; i < Size; i++)
{
Mass = (float) i;
}
SimpleSum sf( Mass );
parallel_reduce( tbb::blocked_range(0, Size), sf );
printf("Result: %f\n", sf.sum);
_aligned_free( Mass );
return 0;
}[/bash]
[bash]ID Problem Sources Modules Object Size State
P1 Memory leak parallel_reduce.h TBB_reduce.exe 140 Not fixed
P2 Memory leak parallel_reduce.h TBB_reduce.exe 80 Not fixed
P3 Memory leak parallel_reduce.h TBB_reduce.exe 40 Not fixed
P4 Memory leak parallel_reduce.h TBB_reduce.exe 60 Not fixed
P5 Memory leak parallel_reduce.h TBB_reduce.exe 80 Not fixed
P6 Memory leak parallel_reduce.h TBB_reduce.exe 80 Not fixed
P7 Memory leak parallel_reduce.h TBB_reduce.exe 80 Not fixed
P8 Memory leak parallel_reduce.h TBB_reduce.exe 100 Not fixed
P9 Memory leak parallel_reduce.h TBB_reduce.exe 112 Not fixed
P10 Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P11 Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P12 Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P13 Memory leak parallel_reduce.h TBB_reduce.exe 112 Not fixed
P14 Memory leak parallel_reduce.h TBB_reduce.exe 112 Not fixed
P15 Memory leak parallel_reduce.h TBB_reduce.exe 84 Not fixed
P16 Memory leak parallel_reduce.h TBB_reduce.exe 112 Not fixed
P17 Memory leak task.cpp tbb_debug.dll 28 Not fixed
[/bash]
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page