Ram/vram

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Hi!

      I'm trying to get the memory checking program to work in Chapter 5 (page 134).

      I'm getting some weird errors though... :(

      Some of the errors I fixed by adding #include <windows.h> at the top.

      Now I'm down to four errors. The first of which is "syntax: missing ';' before 'type'" on the line that says:

      char *buff = GCC_NEW char[virtualRAMNEEDED];

      The only other changes I've made to the code is substituting a message box where it says "throw GameCodeError".

      First off, I *know* I don't have any missing semicolons and MSVC++ ver 6.0 is obviously senile. Secondly, I've double checked my code to make sure it matched the book (other than the #include and message boxes).

      Am I doing something wrong? I didn't see anything about that program on this website...

      Thanks!

      mw
      Blucast Corporation
    • WinAPI code doesn't work with MSVC++?!?!?!

      What the heck?!

      WINDOWS API code doesn't work with MICROSOFTVC++?!?!?!

      Oh, wait... It's Microsoft. Microsoft products only work in a Linux environment! :)

      I Googled GCC_NEW but didn't find anything particularly useful. One website seemed to suggest it was a replacement for malloc()...

      What is GCC_NEW for?

      mw
      Blucast Corporation

      The post was edited 1 time, last by Lionmane ().

    • RE: Ram/vram

      Source Code

      1. #if defined(_DEBUG)
      2. # define GCC_NEW new(_NORMAL_BLOCK,__FILE__, __LINE__)
      3. #else
      4. # define GCC_NEW new
      5. #endif


      Looks like, if _DEBUG is defined it sets the GCC_NEW macro to call a new() macro that manages some debug information for tracking memory allocation errors, and if _DEBUG is not defined it sets the GCC_NEW macro to be the same as the 'new' keyword.
      "Your job is not to die for your country. Your job is to make some other poor sod die for his."