Jump to content

  • Log In with Google      Sign In   
  • Create Account


AlexB.hpp

Member Since 11 Oct 2012
Offline Last Active Aug 23 2013 03:35 AM

Posts I've Made

In Topic: ranges and glsl

06 December 2012 - 10:32 AM

In hlsl there is normalize()... Probably there should be something like that. But you should check this by yourself 'cause I do learn shaders for 2 months and don't know much.

In Topic: [С++] Memory leak checker

02 December 2012 - 11:03 AM

Oh, many thanks again.

Looks like I've fixed the old one problem with infinite loop in stl. So... Actually I've done major work on it.

Ok I pretty sure that realloc is ok now.
It does;
new_ptr = realloc(old_ptr, size)
if (!new_ptr) return old_ptr
return new_ptr

I'll read stuff about exceptions. And figure out how it should be.

I have funny stuff as one of my friends said. I have calls of delete on unregistered ptrs :)
Try to erase unregistered pointer 0x82f10f8!
Memory leak summary:
	    operator new (0x82f1008) missed 4 bytes in main.cpp:5
	    operator new [] (0x82f1040) missed 4 bytes in main.cpp:6
	    malloc (0x82f1078) missed 4 bytes in main.cpp:7
	    calloc (0x82f10b0) missed 4 bytes in main.cpp:8
	    realloc (0x82f10e8) missed 8 bytes in main.cpp:10
Total leaked 24 bytes
Try to erase unregistered pointer 0x82f10f8!
Try to erase unregistered pointer 0x82f10c0!
Try to erase unregistered pointer 0x82f1088!
Try to erase unregistered pointer 0x82f1050!
Try to erase unregistered pointer 0x82f1018!

In Topic: [С++] Memory leak checker

02 December 2012 - 06:28 AM

Damn it, I've stuck a little.

Meet cool bug when some containers of STL use my funcs and do stucking in infinite loop.

You know how it happens - you read about 1000 books of cpp and still doing this stupid mistakes in you code. :D

In Topic: Looking for a study partner at C++, SDL and OpenGL.

02 December 2012 - 06:23 AM

I want to join you guys. I have 4 years experience in C++. Now I'm working on 2d engine with few friends of mine. I'm about 3rd month working in game dev.

It's AlexBolotsin@Gmail.com

In Topic: [С++] Memory leak checker

28 November 2012 - 02:49 PM

That still doesn't handle realloc() properly. You aren't taking into account instances when size is equal to zero and you are also aren't handling null return values properly for what looks like any of the allocation functions. Your code also looks like it blows up messily if your header is included before code that uses placement new (which includes large chunks of the standard library).

Hm. I've read it already. Tomorrow I'll fix it. That bastard is really tricky, too many behaviors for just one func...
About including my header - yeah it has a bug here, I know about it. I'll describe it in docs. Have no ideas now. Thank you.

Some other problems:

  • void* operator new[] is missing a 'return'.
  • Not exception safe (meaning that somewhat ironically, it can cause leaks).
  • Causes problems with existing placement-new overloads (though working around that is probably very tricky).

Many thanks. Still need some tests. It's in todo list.
About placement new... I'll keep it in mind.

PARTNERS