MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / queueGC

Function queueGC

packages/core/utils/index.android.ts:29–57  ·  view source on GitHub ↗
(delay = 900, useThrottle?: boolean)

Source from the content-addressed store, hash-verified

27let debouncedGC: Map<number, () => void>;
28
29export function queueGC(delay = 900, useThrottle?: boolean) {
30 /**
31 * developers can use different queueGC settings to optimize their own apps
32 * each setting is stored in a Map to reuse each time app calls it
33 */
34 if (useThrottle) {
35 if (!throttledGC) {
36 throttledGC = new Map();
37 }
38 if (!throttledGC.get(delay)) {
39 throttledGC.set(
40 delay,
41 throttle(() => GC(), delay),
42 );
43 }
44 throttledGC.get(delay)();
45 } else {
46 if (!debouncedGC) {
47 debouncedGC = new Map();
48 }
49 if (!debouncedGC.get(delay)) {
50 debouncedGC.set(
51 delay,
52 debounce(() => GC(), delay),
53 );
54 }
55 debouncedGC.get(delay)();
56 }
57}
58
59export function releaseNativeObject(object: java.lang.Object) {
60 __releaseNativeCounterpart(object);

Callers

nothing calls this directly

Calls 5

throttleFunction · 0.90
debounceFunction · 0.90
GCFunction · 0.70
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected