Klaim
|
|
« Reply #3880 on: January 26, 2013, 03:47:59 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? You can memory leak with almost any language.
|
|
|
Logged
|
|
|
|
zacaj
|
|
« Reply #3881 on: January 26, 2013, 03:53:50 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? You can memory leak with almost any language. Your point? That has nothing to do with my question.
|
|
|
Logged
|
My twitter: @zacaj_Well let's just take a look at this "getting started" page and see-- Download and install cmake
Noooooooo
|
|
|
kamac
|
|
« Reply #3882 on: January 26, 2013, 04:00:27 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? Definitely. I bet you are about to give me some cool memory-leaks detector program/technique right now. Am I right?
|
|
|
Logged
|
|
|
|
Klaim
|
|
« Reply #3883 on: January 26, 2013, 04:00:39 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? You can memory leak with almost any language. Your point? That has nothing to do with my question. That "maybe not" C/C++. Nothing more.
|
|
|
Logged
|
|
|
|
Klaim
|
|
« Reply #3884 on: January 26, 2013, 04:03:23 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? Definitely. I bet you are about to give me some cool memory-leaks detector program/technique right now. Am I right? Not really, I use VLD on Visual Studio but no memory leak detector is perfect unfortunately. I would recommand using "modern c++" to avoid memory leaks in the first place (if you use C++, not C).
|
|
|
Logged
|
|
|
|
kamac
|
|
« Reply #3885 on: January 26, 2013, 04:11:24 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? Definitely. I bet you are about to give me some cool memory-leaks detector program/technique right now. Am I right? Not really, I use VLD on Visual Studio but no memory leak detector is perfect unfortunately. I would recommand using "modern c++" to avoid memory leaks in the first place (if you use C++, not C). It has to work for android NDK too and for now I couldn't get, for example C++11x's std::function to work. (Since android NDK doesn't seem to support modern C++. Or it's my compiler. I wonder if there are any other)
|
|
|
Logged
|
|
|
|
Klaim
|
|
« Reply #3886 on: January 26, 2013, 04:18:37 PM » |
|
It has to work for android NDK too and for now I couldn't get, for example C++11x's std::function to work. (Since android NDK doesn't seem to support modern C++. Or it's my compiler. I wonder if there are any other)
I wasn't talking about c++11. (Apparently the Android SDK isn't up to date with recent GCC version so you can use C++11 but only in limited ways; also it should be available in the std::tr1 namespace but I didn't check which header because I remember the old gcc header being non-standard for std TR1 stuffs. It that can help you, you'd better use boost if you want to use boost::function, you can just get the boost headers without compilation and boost::function -and may other libs- will work out of the box) Modern C++ is just a way of saying "idiomatic c++" which is in mainly exploiting RAII. Unfortunately very hard to sum up here, and I don't know what you know to help you.
|
|
|
Logged
|
|
|
|
zacaj
|
|
« Reply #3887 on: January 26, 2013, 04:25:37 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? You can memory leak with almost any language. Your point? That has nothing to do with my question. That "maybe not" C/C++. Nothing more. That's sorta the point of asking. Memory leaks. Memory leaks everywhere.
C/C++? Definitely. I bet you are about to give me some cool memory-leaks detector program/technique right now. Am I right? Yep. Nothing mind blowing, but I thought I'd post the code I worked out for tracking allocations. Will probably need a bit of modifications to work into your code, but hopefully will be helpful If you run into problems, PM/email me and I'll try to help http://pastebin.com/zDtkSPbsIt overrides new and delete and keeps a list of everything allocated, and prints a list of what was left over when you exit.
|
|
|
Logged
|
My twitter: @zacaj_Well let's just take a look at this "getting started" page and see-- Download and install cmake
Noooooooo
|
|
|
kamac
|
|
« Reply #3888 on: January 27, 2013, 02:39:26 AM » |
|
you'd better use boost if you want to use boost::function, you can just get the boost headers without compilation and boost::function -and may other libs- will work out of the box I already use it And thanks zacaj, that's rad I won't hesitate to PM you when needed either.
|
|
|
Logged
|
|
|
|
rivon
|
|
« Reply #3889 on: January 27, 2013, 04:01:19 AM » |
|
Valgrind
|
|
|
Logged
|
|
|
|
nikki
|
|
« Reply #3890 on: January 27, 2013, 04:13:33 AM » |
|
valgrind +1
|
|
|
Logged
|
|
|
|
Klaim
|
|
« Reply #3891 on: January 28, 2013, 02:50:24 PM » |
|
Just lost 4 hours hunting a double bug. The initial bug was trigerring another bug that generated a deadlock (yeah I'm having "fun" with multiple threads and processes, quite the ride). I fixed the deadlock after 2 hours, it was just a logic problem and missing functionality on error reporting. The core bug was in the following code. Will you find it? It's easy but I missed it several time while reviewing the code. It appeared only in Release/ReleaseDebug modes AND only if I execute it outside the debugger (which I still don't understand). explicit ZoneElement( IdType id ) : m_id( std::move(m_id), static_cast<T&>(*this) ) // Augment the id object with a pointer to this. { NR_LOG_TRACE( "FROM explicit ZoneElement( IdType id )" ); check_validity(); } I'm also unhappy that visual studio compiler didn't point the problem. I know clang and gcc would have.
|
|
|
Logged
|
|
|
|
BorisTheBrave
|
|
« Reply #3892 on: January 28, 2013, 03:29:31 PM » |
|
You are initializing a variable with itself? What made you think that was a good idea.
|
|
|
Logged
|
|
|
|
Klaim
|
|
« Reply #3893 on: January 28, 2013, 03:38:46 PM » |
|
Exactly, this code have been modified a lot so I made the typo. But the compiler didn't point the fact that I wasn't using one of the arguments of the function...clang and gcc would have pointed this. Even PVS-Studio didnt point this to my great surprise.
Also, this more or less works when the debugger runs. I mean, I got no error, the id isn't null, while it should be (it's its default value) so I have no idea yet how I could have missed it.
I discovered the problem when the serialization code whas checking (in release too) that the id was invalid while it shouldn't be.
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3894 on: January 28, 2013, 08:05:52 PM » |
|
>find bugs in the 2d vector class used by >40 classes.
|
|
|
Logged
|
|
|
|
Muz
|
|
« Reply #3895 on: January 28, 2013, 08:35:05 PM » |
|
Memory leaks. Memory leaks everywhere.
C/C++? You can memory leak with almost any language. Yeah, but much more easily with C/C++. Avoiding memory leaks in C(++) is a trained skill in itself
|
|
|
Logged
|
|
|
|
Code_Assassin
|
|
« Reply #3896 on: January 28, 2013, 09:20:28 PM » |
|
>find bugs in the 2d vector class used by >40 classes. lol how did that even happen? O_O
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3897 on: January 28, 2013, 09:52:52 PM » |
|
lol how did that even happen? O_O Some legacy shit, potentially optimisation related, not my code, still my problem.
|
|
|
Logged
|
|
|
|
eigenbom
|
|
« Reply #3898 on: January 28, 2013, 11:21:21 PM » |
|
stuffing around with win32 all day to "quickly make a simple and minimal launcher for moonman". big mistake. fwiw win32++ eased my pain. the crappiest thing is that I already had written a launcher using fltk, but thought that using win32 would allow the combobox to be drawn outside of its parent window, but alas no.
|
|
|
Logged
|
|
|
|
Liosan
|
|
« Reply #3899 on: January 29, 2013, 12:37:08 AM » |
|
>find bugs in the 2d vector class used by >40 classes. ... did you break some other classes after you fixed the vector? Happened to me once... bugs hidden under bugs... Liosan
|
|
|
Logged
|
|
|
|
|