Skip to content

Commit

Permalink
docs(feature): Static initialisation no longer runs multiple times as…
Browse files Browse the repository at this point in the history
… of 2024.11, add a method of restoring old behaviour

YoYoGames/GameMaker-Bugs#7888

Added "AllowReentrantStatic" to the gml_pragma() page
  • Loading branch information
YYBartT committed Oct 5, 2024
1 parent 0c6616f commit b8e7355
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ <h1><span data-field="title" data-format="default">gml_pragma</span></h1>
<p class="code"><span data-field="title" data-format="default">gml_pragma</span>(&quot;UnityBuild&quot;, &quot;true&quot;);</p>
The benefit of doing a unity build is that builds are faster but the down side is that it does a <i>full</i> build each time so even if you change a single part of the code it will build everything again without using any cached files. This has been added specifically for the Xbox One export using the YYC although it can be called for other builds (<b>YYC only</b>). For more information on unity builds, please see <a href="https://buffered.io/posts/the-magic-of-unity-builds/" target="_blank">here</a>.
</li>
<li>&quot;<strong>AllowReentrantStatic</strong>&quot; - This pragma reverts static initialisation to the old re-entrant initialisation behaviour of <span data-keyref="GameMaker Name">GameMaker</span> versions up to 2024.8. It is a project-wide setting and so cannot be put around code sections. The following code enables this old behaviour: 
<p class="code"><span data-field="title" data-format="default">gml_pragma</span>( &quot;AllowReentrantStatic&quot;, true);</p>
<p><span data-conref="../../../assets/snippets/Tag_warning.hts"> </span> You should only use this in existing projects that make use of the old behaviour. GMRT will no longer allow it.</p>
</li>
</ul>
<p class="note"><span data-conref="../../../assets/snippets/Tag_note.hts"> </span> The first argument to the <span class="inline3_func"><span data-field="title" data-format="default">gml_pragma</span></span> function <b>must be a compile-time string constant</b> and not a variable.</p>
<p><a class="dropspot" data-open-text="" data-rhwidget="DropSpot" data-target="compiler-optimisations" href="#">Compiler Optimisations</a>
Expand Down

0 comments on commit b8e7355

Please sign in to comment.