Search:

Type: Posts; User: twinbee

Search: Search took 0.01 seconds.

  1. Well, "Space expensive" in that it can double,...

    Well, "Space expensive" in that it can double, quadruple, or octuple a function's size which in many cases would still be absolutely fine.

    Yes, I tried setting the "Favor Size or Speed" setting to...
  2. Huh, I thought we established that VS was...

    Huh, I thought we established that VS was ignoring the loop-unswitching optimization. Simply removing the If statement altogether shows that it does indeed run faster. I haven't gotten round to...
  3. Just to update the situation of this problem: I...

    Just to update the situation of this problem: I have since upgraded from VS 2008 express to VS 2010 Professional and the problem still exists. Loop unswitching still isn't supported, at least judging...
  4. Heh, I get so confused regarding GPL - I'll have...

    Heh, I get so confused regarding GPL - I'll have to read up further. Just to be clear, when you say 'linking', I presume you mean static linking to make a giant executable which has GCC stuff in it....
  5. GCC is GPL which means I would need to provide my...

    GCC is GPL which means I would need to provide my own software as open source AFAIK.

    Borland have a confusing license for 5.5 which mentions "nothing to be redistributed, apart from certain...
  6. Compiler redistribution (Microsoft or Borland)

    Would I be able to redistribute the Borland C/C++ compiler (their free 5.5 version) or the Microsoft C++ Visual Express compiler with my own software (which may be potentially commercial and close...
  7. That old cookie? Can't you do better do that? ...

    That old cookie? Can't you do better do that?

    Just kidding (sorry). That is pretty advanced.

    I'm kind of at the stage where I can start to do tricks like using pure malloced arrays instead of...
  8. Replies
    3
    Views
    1,286

    Thanks. Can you confirm that B would crash or...

    Thanks. Can you confirm that B would crash or produce strange output (even without any memory leak) if the program was longer? I still don't understand why it's bad though, since the variable that's...
  9. Replies
    3
    Views
    1,286

    Variable/pointer scope (rookie Qs)

    I have 3 pieces of code below. A simple one really - just need to know which ones are safe. I think A and maybe C is safe. However, B is dangerous from my experience, but I'm not exactly sure why as...
  10. The section of code in question I could squeeze...

    The section of code in question I could squeeze down to only around 1-2k. I'm more than happy to use 64 or even 32 duplicates. In any case, the example code I posted in this thread could easily be...
  11. Correct. Within reason, I agree. Optimization...

    Correct.

    Within reason, I agree. Optimization if done at all should come at the end of the project. However, we're talking about code we aren't even going to see, because the compiler keeps it...
  12. Thanks for trying to help. You may well be...

    Thanks for trying to help.


    You may well be right that the compiler is simply deleting the math line when I comment out the scanf line - I did consider that. But my point is that I still want to...
  13. Internal automatic loop unswitching would be even...

    Internal automatic loop unswitching would be even nicer though, and I thought C++ 2008 Express would've supported that. Thanks anyway, I may end up using that technique even if only as a last resort....
  14. itCbitC, if you mean manually coding the two...

    itCbitC, if you mean manually coding the two loops myself, then it's impractical because maintenance would be a nightmare (my real program isn't the example above, but hundreds of lines). Any change...
  15. There's a difference between loop unrolling and...

    There's a difference between loop unrolling and loop unswitching. Loop unswitching will only duplicate the function, one with the conditional section and one without. First though it has to prove...
  16. Lack of compiler loop optimization (Loop unswitching) ?

    Using Visual C++ 2008 (express), the following program will finish on my CPU in either 1 second or around 4 seconds according to whether the scanf("%i",&tt) line is quoted or not.

    If it is...
  17. Replies
    12
    Views
    1,398

    Passing array of arbitrary dimension

    Say I want to create a function which finds the highest number in an array of arbitrary dimension, how would I construct the parameters to receive such a variable?

    I don't want to create max...
  18. Replies
    2
    Views
    1,948

    That's funny - I'm sure I tried using a looped...

    That's funny - I'm sure I tried using a looped fwrite with d[m] only, but maybe I got something else wrong.

    In any case, thanks it works now!

    I don't know, I'm so lucky really - if this was an...
  19. Replies
    2
    Views
    1,948

    Crash with fwrite and large 2D arrays

    I use the mingw compiler (with Dev-c++), but I'm wondering if this problem applies to all C compilers.

    The below program crashes. However, if you set k (or l) to a lower number, say change k from...
Results 1 to 19 of 19