Skip to content

Commit b1371f5

Browse files
MaxGraeydcodeIO
authored andcommitted
Expose __reset for stub runtime and update allocator tests (#1045)
1 parent 5d92a64 commit b1371f5

File tree

17 files changed

+4588
-6708
lines changed

17 files changed

+4588
-6708
lines changed

lib/loader/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ interface ASUtil {
5555
__retain(ptr: number): number;
5656
/** Releases a previously retained reference to a managed object, allowing the runtime to collect it once its reference count reaches zero. */
5757
__release(ptr: number): void;
58+
/** Resets base pointer to initial offset. Uses only for stub runtime. */
59+
__reset?(): void;
5860
/** Allocates an instance of the class represented by the specified id. */
5961
__alloc(size: number, id: number): number;
6062
/** Tests whether a managed object is an instance of the class represented by the specified base id. */

std/assembly/rt/index-stub.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { __alloc, __retain, __release, __collect } from "rt/stub";
1+
export { __alloc, __retain, __release, __collect, __reset } from "rt/stub";
22
export { __rtti_base } from "rt";

std/assembly/rt/pure.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,3 @@ export function __retain(ptr: usize): usize {
260260
export function __release(ptr: usize): void {
261261
if (ptr > __heap_base) decrement(changetype<Block>(ptr - BLOCK_OVERHEAD));
262262
}
263-
264-
// @ts-ignore: decorator
265-
@global @unsafe
266-
export function __reset(): void {
267-
}

0 commit comments

Comments
 (0)