You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Merge pull request #9720 from endragor/stack-bottom
Add a way to retrieve stack bottom of the main thread
This commit is contained in:
@@ -512,7 +512,13 @@ bool OS::check_feature_support(const String &p_feature) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void *OS::get_stack_bottom() const {
|
||||
return _stack_bottom;
|
||||
}
|
||||
|
||||
OS::OS() {
|
||||
void *volatile stack_bottom;
|
||||
|
||||
last_error = NULL;
|
||||
singleton = this;
|
||||
_keep_screen_on = true; // set default value to true, because this had been true before godot 2.0.
|
||||
@@ -525,6 +531,7 @@ OS::OS() {
|
||||
_render_thread_mode = RENDER_THREAD_SAFE;
|
||||
|
||||
_allow_hidpi = true;
|
||||
_stack_bottom = (void *)(&stack_bottom);
|
||||
}
|
||||
|
||||
OS::~OS() {
|
||||
|
||||
@@ -60,6 +60,8 @@ class OS {
|
||||
|
||||
char *last_error;
|
||||
|
||||
void *_stack_bottom;
|
||||
|
||||
public:
|
||||
enum RenderThreadMode {
|
||||
|
||||
@@ -411,6 +413,13 @@ public:
|
||||
|
||||
bool check_feature_support(const String &p_feature);
|
||||
|
||||
/**
|
||||
* Returns the stack bottom of the main thread of the application.
|
||||
* This may be of use when integrating languages with garbage collectors that
|
||||
* need to check whether a pointer is on the stack.
|
||||
*/
|
||||
virtual void *get_stack_bottom() const;
|
||||
|
||||
bool is_hidpi_allowed() const { return _allow_hidpi; }
|
||||
OS();
|
||||
virtual ~OS();
|
||||
|
||||
Reference in New Issue
Block a user