Skip to content

Conversation

@yuyichao
Copy link
Contributor

So that it doesn't confuse people reading the code or mess with editor formatting.

  1. Require semicolon after JL_(UN)LOCK.

  2. Make FOR_*_HEAP macros (use and) behave like for loops.

    • The restructuring of some FOR_CURRENT_HEAP is because GCC and Clang cannot figure out (before optimization) that the loop body (with a single return) is always executed and give a warning about not returning a value when reaching the end of the function.
    • The FOR_*_HEAP macros are changed to function form to match C control flow syntax and possibly help editors to understand that it's not a type declaration. It doesn't really affect formatting and can be removed if people hate it.....

    @tkelman Someone claimed that the for loop trick might not work with MSVC. I guess it's due to declaration of an anonymous struct in the for loop or because MSVC doesn't support this C99 feature in C mode(edit: not for this reason, the example in that thread was also C++). I think this patch should be fine since the struct is declared outside the loop and we are compiling with C++. Could you please verify?

@yuyichao
Copy link
Contributor Author

= = .....

Force push to trigger another build to see if any of these issues presist.

@tkelman
Copy link
Contributor

tkelman commented Nov 13, 2015

Looks like MSVC 2013 handles this fine, though I haven't attempted building the threading code under MSVC.

@yuyichao
Copy link
Contributor Author

The syntax I'm worrying about is in both threading and non-threading version of the code.

@yuyichao
Copy link
Contributor Author

I added a note about the gcc/clang warning bug. Will merge tomorrow if people are fine with this...

yuyichao added a commit that referenced this pull request Nov 21, 2015
Make threading macros follow C syntax
@yuyichao yuyichao merged commit 80031a2 into master Nov 21, 2015
@yuyichao yuyichao deleted the yyc/thread-macros branch November 21, 2015 12:59
Keno added a commit that referenced this pull request Nov 23, 2015
As of #13960, MEMDEBUG mode would allocate in pools, but mark as if
it were a bigobj, leading to quite suble corruption (that only shows
up if you are trying to debug a memory problem)
Keno added a commit that referenced this pull request Nov 23, 2015
As of #13960, MEMDEBUG mode would allocate in pools, but mark as if
it were a bigobj, leading to quite suble corruption (that only shows
up if you are trying to debug a memory problem)
@Keno Keno mentioned this pull request Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants