mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-18 09:21:35 +00:00
eliminate retainRelease and skippedRelease
This commit is contained in:
@ -27,12 +27,6 @@ Interface
|
||||
|
||||
### Internals
|
||||
|
||||
* **__retainRelease**(oldRef: `usize`, newRef: `usize`): `usize`<br />
|
||||
Retains a reference to a new object type while releasing the reference it replaces. Returns the retained reference. This is a workaround.
|
||||
|
||||
* **__skippedRelease**(oldRef: `usize`, newRef: `usize`): `usize`<br />
|
||||
Ignores a reference to a new object type while releasing the reference it replaces. Returns the ignored reference. This is a workaround.
|
||||
|
||||
* **__visit**(ref: `usize`, cookie: `u32`): `void`<br />
|
||||
Concrete visitor implementation called during traversal. Cookie can be used to indicate one of multiple operations.
|
||||
|
||||
|
2
std/assembly/rt/index.d.ts
vendored
2
std/assembly/rt/index.d.ts
vendored
@ -3,8 +3,6 @@ declare function __realloc(ref: usize, size: usize): usize;
|
||||
declare function __free(ref: usize): void;
|
||||
declare function __retain(ref: usize): void;
|
||||
declare function __release(ref: usize): void;
|
||||
declare function __retainRelease(oldRef: usize, newRef: usize): usize;
|
||||
declare function __skippedRelease(oldRef: usize, newRef: usize): usize;
|
||||
declare function __collect(): void;
|
||||
declare function __typeinfo(id: u32): u32;
|
||||
declare function __instanceof(ref: usize, superId: u32): bool;
|
||||
|
@ -255,21 +255,3 @@ export function __retain(ref: usize): usize {
|
||||
export function __release(ref: usize): void {
|
||||
if (ref > HEAP_BASE) decrement(changetype<Block>(ref - BLOCK_OVERHEAD));
|
||||
}
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@global @unsafe
|
||||
export function __retainRelease(oldRef: usize, newRef: usize): usize {
|
||||
if (newRef != oldRef) {
|
||||
let heapBase = HEAP_BASE;
|
||||
if (newRef > heapBase) increment(changetype<Block>(newRef - BLOCK_OVERHEAD));
|
||||
if (oldRef > heapBase) decrement(changetype<Block>(oldRef - BLOCK_OVERHEAD));
|
||||
}
|
||||
return newRef;
|
||||
}
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@global @unsafe
|
||||
export function __skippedRelease(oldRef: usize, newRef: usize): usize {
|
||||
if (oldRef > HEAP_BASE) decrement(changetype<Block>(oldRef - BLOCK_OVERHEAD));
|
||||
return newRef;
|
||||
}
|
||||
|
@ -71,18 +71,6 @@ export function __release(ref: usize): void {
|
||||
export function __visit(ref: usize, cookie: u32): void {
|
||||
}
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@global @unsafe
|
||||
export function __retainRelease(oldRef: usize, newRef: usize): usize {
|
||||
return newRef;
|
||||
}
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@global @unsafe
|
||||
export function __skippedRelease(oldRef: usize, newRef: usize): usize {
|
||||
return newRef;
|
||||
}
|
||||
|
||||
// @ts-ignore: decorator
|
||||
@global @unsafe
|
||||
export function __collect(): void {
|
||||
|
Reference in New Issue
Block a user