advent-of-code-wasm
Advanced tools
Comparing version 2022.0.57 to 2022.0.61
@@ -42,3 +42,3 @@ let imports = {}; | ||
const buf = cachedTextEncoder.encode(arg); | ||
const ptr = malloc(buf.length); | ||
const ptr = malloc(buf.length, 1) >>> 0; | ||
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); | ||
@@ -50,3 +50,3 @@ WASM_VECTOR_LEN = buf.length; | ||
let len = arg.length; | ||
let ptr = malloc(len); | ||
let ptr = malloc(len, 1) >>> 0; | ||
@@ -67,3 +67,3 @@ const mem = getUint8Memory0(); | ||
} | ||
ptr = realloc(ptr, len, len = offset + arg.length * 3); | ||
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; | ||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len); | ||
@@ -106,2 +106,3 @@ const ret = encodeString(arg, view); | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
@@ -139,2 +140,4 @@ } | ||
module.exports.solve = function(year, day, part, input) { | ||
let deferred3_0; | ||
let deferred3_1; | ||
try { | ||
@@ -149,9 +152,11 @@ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
var ptr1 = r0; | ||
var len1 = r1; | ||
var ptr2 = r0; | ||
var len2 = r1; | ||
if (r3) { | ||
ptr1 = 0; len1 = 0; | ||
ptr2 = 0; len2 = 0; | ||
throw takeObject(r2); | ||
} | ||
return getStringFromWasm0(ptr1, len1); | ||
deferred3_0 = ptr2; | ||
deferred3_1 = len2; | ||
return getStringFromWasm0(ptr2, len2); | ||
} finally { | ||
@@ -162,3 +167,3 @@ wasm.__wbindgen_add_to_stack_pointer(16); | ||
heap[stack_pointer++] = undefined; | ||
wasm.__wbindgen_free(ptr1, len1); | ||
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); | ||
} | ||
@@ -179,6 +184,6 @@ }; | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
@@ -193,3 +198,3 @@ | ||
module.exports.__wbg_new_15d3966e9981a196 = function(arg0, arg1) { | ||
module.exports.__wbg_new_a64e3f2afc2cf2f8 = function(arg0, arg1) { | ||
const ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
@@ -196,0 +201,0 @@ return addHeapObject(ret); |
@@ -10,3 +10,3 @@ { | ||
"description": "Solutions to Advent of Code written in Rust", | ||
"version": "2022.0.57", | ||
"version": "2022.0.61", | ||
"license": "MIT", | ||
@@ -13,0 +13,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
1086686
191