mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 15:01:28 +00:00
Rename wast to wat
This commit is contained in:
@ -10,6 +10,7 @@ const ALIGN_MASK: usize = ALIGN_SIZE - 1;
|
||||
|
||||
var HEAP_OFFSET: usize = HEAP_BASE;
|
||||
|
||||
@global
|
||||
export function allocate_memory(size: usize): usize {
|
||||
if (!size) return 0;
|
||||
var ptr = HEAP_OFFSET;
|
||||
@ -25,10 +26,12 @@ export function allocate_memory(size: usize): usize {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@global
|
||||
export function free_memory(ptr: usize): void {
|
||||
// nop
|
||||
}
|
||||
|
||||
@global
|
||||
export function reset_memory(): void {
|
||||
HEAP_OFFSET = HEAP_BASE;
|
||||
}
|
||||
|
@ -7,12 +7,15 @@
|
||||
declare function _malloc(size: usize): usize;
|
||||
declare function _free(ptr: usize): void;
|
||||
|
||||
@global
|
||||
export function allocate_memory(size: usize): usize {
|
||||
return _malloc(size);
|
||||
}
|
||||
|
||||
@global
|
||||
export function free_memory(ptr: usize): void {
|
||||
_free(ptr);
|
||||
}
|
||||
|
||||
@global
|
||||
export { reset_memory } from "./none";
|
||||
|
@ -6,12 +6,15 @@
|
||||
declare function malloc(size: usize): usize;
|
||||
declare function free(ptr: usize): void;
|
||||
|
||||
@global
|
||||
export function allocate_memory(size: usize): usize {
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
@global
|
||||
export function free_memory(ptr: usize): void {
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
@global
|
||||
export { reset_memory } from "./none";
|
||||
|
@ -431,6 +431,7 @@ var ROOT: Root = changetype<Root>(0);
|
||||
// External interface
|
||||
|
||||
/** Allocates a chunk of memory. */
|
||||
@global
|
||||
export function allocate_memory(size: usize): usize {
|
||||
|
||||
// initialize if necessary
|
||||
@ -474,6 +475,7 @@ export function allocate_memory(size: usize): usize {
|
||||
}
|
||||
|
||||
/** Frees the chunk of memory at the specified address. */
|
||||
@global
|
||||
export function free_memory(data: usize): void {
|
||||
if (data) {
|
||||
var root = ROOT;
|
||||
|
4
std/portable.d.ts
vendored
4
std/portable.d.ts
vendored
@ -179,9 +179,9 @@ declare class String {
|
||||
static fromCodePoints(arr: i32[]): string;
|
||||
readonly length: i32;
|
||||
private constructor();
|
||||
indexOf(subject: string): i32;
|
||||
indexOf(subject: string, position?: i32): i32;
|
||||
includes(other: string): bool;
|
||||
lastIndexOf(subject: string): i32;
|
||||
lastIndexOf(subject: string, position?: i32): i32;
|
||||
charAt(index: i32): string;
|
||||
charCodeAt(index: i32): i32;
|
||||
substring(from: i32, to?: i32): string;
|
||||
|
Reference in New Issue
Block a user