mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 06:21:29 +00:00
Also lint stdlib
This commit is contained in:
@ -3,8 +3,7 @@ var globalScope = typeof window !== "undefined" && window || typeof global !== "
|
||||
var HEAP = new Uint8Array(0);
|
||||
var HEAP_OFFSET = 0;
|
||||
|
||||
globalScope["allocate_memory"] =
|
||||
function allocate_memory(size) {
|
||||
globalScope["allocate_memory"] = function allocate_memory(size) {
|
||||
if (!(size >>>= 0))
|
||||
return 0;
|
||||
if (HEAP_OFFSET + size > HEAP.length) {
|
||||
@ -18,25 +17,21 @@ function allocate_memory(size) {
|
||||
return ptr;
|
||||
};
|
||||
|
||||
globalScope["free_memory"] =
|
||||
function free_memory(ptr) {
|
||||
globalScope["free_memory"] = function free_memory(ptr) {
|
||||
// TODO
|
||||
};
|
||||
|
||||
globalScope["move_memory"] =
|
||||
function move_memory(dest, src, n) {
|
||||
globalScope["move_memory"] = function move_memory(dest, src, n) {
|
||||
HEAP.copyWithin(dest, src, src + n);
|
||||
};
|
||||
|
||||
globalScope["store"] =
|
||||
function store(ptr, val, off) {
|
||||
globalScope["store"] = function store(ptr, val, off) {
|
||||
if (typeof off === "number")
|
||||
ptr += off;
|
||||
HEAP[ptr] = val;
|
||||
};
|
||||
|
||||
globalScope["load"] =
|
||||
function load(ptr) {
|
||||
globalScope["load"] = function load(ptr) {
|
||||
if (typeof off === "number")
|
||||
ptr += off;
|
||||
return HEAP[ptr];
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "../portable.json",
|
||||
"compilerOptions": {
|
||||
"diagnostics": true
|
||||
},
|
||||
"include": [
|
||||
"./**/*.ts"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user