mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-27 07:52:14 +00:00
17 lines
470 B
TypeScript
17 lines
470 B
TypeScript
/// <reference path="./collector/index.d.ts" />
|
|
|
|
/** Garbage collector interface. */
|
|
export namespace gc {
|
|
|
|
/** Whether the garbage collector interface is implemented. */
|
|
// @ts-ignore: decorator
|
|
@lazy
|
|
export const IMPLEMENTED: bool = isDefined(__ref_collect);
|
|
|
|
/** Performs a full garbage collection cycle. */
|
|
export function collect(): void {
|
|
if (isDefined(__ref_collect)) __ref_collect();
|
|
else WARNING("missing implementation: gc.collect");
|
|
}
|
|
}
|