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

Function queueGC

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

Source from the content-addressed store, hash-verified

39let debouncedGC: Map<number, () => void>;
40
41export function queueGC(delay = 900, useThrottle?: boolean) {
42 /**
43 * developers can use different queueGC settings to optimize their own apps
44 * each setting is stored in a Map to reuse each time app calls it
45 */
46 if (useThrottle) {
47 if (!throttledGC) {
48 throttledGC = new Map();
49 }
50 if (!throttledGC.get(delay)) {
51 throttledGC.set(
52 delay,
53 throttle(() => GC(), delay),
54 );
55 }
56 throttledGC.get(delay)();
57 } else {
58 if (!debouncedGC) {
59 debouncedGC = new Map();
60 }
61 if (!debouncedGC.get(delay)) {
62 debouncedGC.set(
63 delay,
64 debounce(() => GC(), delay),
65 );
66 }
67 debouncedGC.get(delay)();
68 }
69}
70
71export function releaseNativeObject(object: NSObject) {
72 __releaseNativeCounterpart(object);

Callers 4

getImageAsyncMethod · 0.90
disposeImageSourceMethod · 0.90
setTintColorMethod · 0.90
_setNativeImageMethod · 0.90

Calls 5

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

Tested by

no test coverage detected