Results 1 to 5 of 5

Thread: Includes and their size

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Includes and their size

    I have tried to get myself into the habit of making sure I HAVE to include a thing like windows.h before I do...and if I do I almost always put the WIN32_LEAN_AND_MEAN macro.

    Well, I have a WaveClass which is used to load up waves and such with play functions...but mainly I just need to loaded wave to pass into DirectSound Buffers.

    The wave class needs GlobalAlloc, and GlobalLock, BYTE, DWORD...etc
    I have to include MMSystem.h, and Windows.h. Will this lengthen the size in memory of the wave class?
    There is a good chance I could have 100+ of these class's loaded at any time. If those extra includes are goona cause some runtime slowdowns or extra size during runtime then i need to find a way around it.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Not 100% sure...but pretty.....it will only include it one time...not every time for every new object. So no, it won't make that much diffrence.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Properly written header files, especially system includes, never increase final code size, only compile time. The only exception are inlines, which ought to be thrown out if not used.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by CornedBee
    Properly written header files, especially system includes, never increase final code size, only compile time. The only exception are inlines, which ought to be thrown out if not used.

    What about Templates...they would do that too, wont they?

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Templates only exist in the final code if you actually use them.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width