Refactor performance memory API implementation

Summary:
This diff refactors performance memory API and the RN Tester example.

- The returned value from C++ is number, so no need to cast
- Reuse `MemoryInfo` in RNTester example

Changelog:
[General][Internal] - Code refactor for performance memory API implementation

Reviewed By: rubennorte

Differential Revision: D43523878

fbshipit-source-id: 37d1f6a829a8eac45f7e3791ad36be0c199c6041
This commit is contained in:
Xin Chen
2023-03-07 18:32:20 -08:00
committed by Facebook GitHub Bot
parent 96659f8e83
commit f4e56fdf19
3 changed files with 20 additions and 25 deletions
+9
View File
@@ -31,14 +31,23 @@ export default class MemoryInfo {
}
}
/**
* The maximum size of the heap, in bytes, that is available to the context
*/
get jsHeapSizeLimit(): ?number {
return this._jsHeapSizeLimit;
}
/**
* The total allocated heap size, in bytes
*/
get totalJSHeapSize(): ?number {
return this._totalJSHeapSize;
}
/**
* The currently active segment of JS heap, in bytes.
*/
get usedJSHeapSize(): ?number {
return this._usedJSHeapSize;
}