From f9238d6d016fbc0c28af60948d5ca0c3df32fa40 Mon Sep 17 00:00:00 2001 From: DieMyst Date: Wed, 14 Aug 2019 12:37:39 +0300 Subject: [PATCH] change alloc id --- assembly/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assembly/index.ts b/assembly/index.ts index 54da2db..da9c5c6 100644 --- a/assembly/index.ts +++ b/assembly/index.ts @@ -41,7 +41,7 @@ export function readRequestString(ptr: i32, size: i32): string { */ export function writeResponseBytes(response: Uint8Array): i32 { let len: i32 = response.length; - let addr = __alloc(len + RESPONSE_SIZE_BYTES, 1); + let addr = __alloc(len + RESPONSE_SIZE_BYTES, 0); for (let i = 0; i < RESPONSE_SIZE_BYTES; i++) { let b: u8 = (len >> i * 8) as u8 & 0xFF; store(addr + i, b); @@ -65,7 +65,7 @@ export function writeResponseBytes(response: Uint8Array): i32 { */ export function writeResponseString(response: string): i32 { let strLen: i32 = response.length; - let addr = __alloc(strLen + RESPONSE_SIZE_BYTES, 1); + let addr = __alloc(strLen + RESPONSE_SIZE_BYTES, 0); for (let i = 0; i < RESPONSE_SIZE_BYTES; i++) { let b: u8 = (strLen >> i * 8) as u8 & 0xFF; store(addr + i, b);