Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualCornstalks

Posted 11 September 2012 - 10:33 AM

  • Identifiers starting with an underscore in the global scope are reserved for the implementation, so I wouldn't prefix globals with "_". Namespaces are your friend.
  • <stdio.h> is a C header. The C++ equivalent is <cstdio>. I'm actually not entirely sure why you include it.
  • You should be reporting errors to std::cerr, not std::cout.
  • Don't exit() when an allocation fails. Let the user determine if it's fatal. Throw a std::bad_alloc exception, like the normal new operator does.
  • Any planned future support for multithreading (it'll wreck havoc with your current global state)?
  • It would be useful if it didn't call any Windows specific functions so that it would be cross platform. Maybe output results/leaks to a log file?

Overall, it's a cool idea, and I think with some changes suggested by fastcall22 and me (and others who contribute), it could be a cool little project.

#2Cornstalks

Posted 11 September 2012 - 10:33 AM

  • Identifiers starting with an underscore in the global scope are reserved for the implementation, so I wouldn't prefix globals with "_". Namespaces are your friend.
  • <stdio.h> is a C header. The C++ equivalent is <cstdio>. I'm actually not entirely sure why you include it.
  • You should be reporting errors to std::cerr, not std::cout.
  • Don't exit() when an allocation fails. Let the user determine if it's fatal. Throw a std::bad_alloc exception, like the normal new operator does.
  • Any planned future support for multithreading (it'll wreck havoc with your current global state)?
  • It would be useful if it didn't call any Windows specific functions so that it would be cross platform. Maybe output results/leaks to a log file?
Overall, it's a cool idea, and I think with some changes suggested by fastcall22 and me (and others who contribute), it could be a cool little project.

#1Cornstalks

Posted 11 September 2012 - 10:31 AM

  • Identifiers starting with an underscore in the global scope are reserved for the implementation, so I wouldn't prefix globals with "_". Namespaces are your friend.
  • <stdio.h> is a C header. The C++ equivalent is <cstdio>. I'm actually not entirely sure why you include it.
  • You should be reporting errors to std::cerr, not std::cout.
  • Don't exit() when an allocation fails. Let the user determine if it's fatal. Throw a std::bad_alloc exception, like the normal new operator does.
  • It would be useful if it didn't call any Windows specific functions so that it would be cross platform. Maybe output results/leaks to a log file?

Overall, it's a cool idea, and I think with some changes suggested by fastcall22 and me (and others who contribute), it could be a cool little project.

PARTNERS