diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/core_bind.cpp | 5 | ||||
-rw-r--r-- | core/core_bind.h | 1 | ||||
-rw-r--r-- | core/os/os.cpp | 11 | ||||
-rw-r--r-- | core/os/os.h | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index f2eb7823e2..c7cd797f4d 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -425,6 +425,10 @@ uint64_t OS::get_static_memory_peak_usage() const { return ::OS::get_singleton()->get_static_memory_peak_usage(); } +Dictionary OS::get_memory_info() const { + return ::OS::get_singleton()->get_memory_info(); +} + /** This method uses a signed argument for better error reporting as it's used from the scripting API. */ void OS::delay_usec(int p_usec) const { ERR_FAIL_COND_MSG( @@ -582,6 +586,7 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_static_memory_usage"), &OS::get_static_memory_usage); ClassDB::bind_method(D_METHOD("get_static_memory_peak_usage"), &OS::get_static_memory_peak_usage); + ClassDB::bind_method(D_METHOD("get_memory_info"), &OS::get_memory_info); ClassDB::bind_method(D_METHOD("move_to_trash", "path"), &OS::move_to_trash); ClassDB::bind_method(D_METHOD("get_user_data_dir"), &OS::get_user_data_dir); diff --git a/core/core_bind.h b/core/core_bind.h index 675da48591..c7d597562a 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -190,6 +190,7 @@ public: uint64_t get_static_memory_usage() const; uint64_t get_static_memory_peak_usage() const; + Dictionary get_memory_info() const; void delay_usec(int p_usec) const; void delay_msec(int p_msec) const; diff --git a/core/os/os.cpp b/core/os/os.cpp index ef7d860d19..49b47c6c12 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -295,8 +295,15 @@ Error OS::set_cwd(const String &p_cwd) { return ERR_CANT_OPEN; } -uint64_t OS::get_free_static_memory() const { - return Memory::get_mem_available(); +Dictionary OS::get_memory_info() const { + Dictionary meminfo; + + meminfo["physical"] = -1; + meminfo["free"] = -1; + meminfo["available"] = -1; + meminfo["stack"] = -1; + + return meminfo; } void OS::yield() { diff --git a/core/os/os.h b/core/os/os.h index d77890d89d..076a9db55c 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -229,7 +229,7 @@ public: virtual uint64_t get_static_memory_usage() const; virtual uint64_t get_static_memory_peak_usage() const; - virtual uint64_t get_free_static_memory() const; + virtual Dictionary get_memory_info() const; RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; } |