diff options
| author | Rusty Wagner <rusty@vector35.com> | 2019-04-30 20:15:28 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2019-04-30 20:16:22 -0400 |
| commit | 9331755a3986941375d0362c098979e3d8b59dc9 (patch) | |
| tree | f197c9bab21acfb07e5ecd5f81a423a65d278776 /python | |
| parent | b1460bf69207f4a4719e8a809a4744817dac01cf (diff) | |
Add unit test to detect memory leaks
Diffstat (limited to 'python')
| -rw-r--r-- | python/__init__.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/python/__init__.py b/python/__init__.py index 711a178a..c659aa1c 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -304,4 +304,14 @@ def core_ui_enabled(): def core_set_license(licenseData): '''Set the Binary Ninja license data, an alternative to storing a ``license.dat`` file''' - core.BNSetLicense(licenseData)
\ No newline at end of file + core.BNSetLicense(licenseData) + + +def get_memory_usage_info(): + count = ctypes.c_ulonglong() + info = core.BNGetMemoryUsageInfo(count) + result = {} + for i in range(0, count.value): + result[info[i].name] = info[i].value + core.BNFreeMemoryUsageInfo(info, count.value) + return result |
