@@ -129,7 +129,7 @@ def __init__(self, DEBUG: bool, target: Target, outdir: str, **kwargs):
129129 isWasmInitialized = true;
130130}
131131
132- const fn_list = ["uuuuuu", "buuuuu", "bbuuuu", "bbbuuu", "bbbbuu", "bbbbbu",
132+ const fn_list = ["uuuuuu", "buuuuu", "buubuu", "buubub", " bbuuuu", "bbbuuu", "bbbbuu", "bbbbbu",
133133 "bbbbbb", "ubuubu", "ubuuuu", "ubbuuu", "uubuuu", "uubbuu", "uububu", "ububuu", "uuuubu"];
134134
135135/* @internal */
@@ -290,6 +290,19 @@ def __init__(self, DEBUG: bool, target: Target, outdir: str, **kwargs):
290290 return actualArray;
291291}
292292/* @internal */
293+ export function decodeUint32Array (arrayPointer: number, free = true): Uint32Array {
294+ const arraySize = getArrayLength(arrayPointer);
295+ const actualArrayViewer = new Uint32Array(wasm.memory.buffer, arrayPointer + 8, arraySize);
296+ // Clone the contents, TODO: In the future we should wrap the Viewer in a class that
297+ // will free the underlying memory when it becomes unreachable instead of copying here.
298+ // Note that doing so may have edge-case interactions with memory resizing (invalidating the buffer).
299+ const actualArray = actualArrayViewer.slice(0, arraySize);
300+ if (free) {
301+ wasm.TS_free(arrayPointer);
302+ }
303+ return actualArray;
304+ }
305+ /* @internal */
293306export function decodeUint64Array (arrayPointer: number, free = true): BigUint64Array {
294307 const arraySize = getArrayLength(arrayPointer);
295308 const actualArrayViewer = new BigUint64Array(
@@ -954,6 +967,8 @@ def primitive_arr_to_hu(self, arr_ty, fixed_len, arr_name, conv_name):
954967 return "const " + conv_name + ": Uint8Array = bindings.decodeUint8Array(" + arr_name + ");"
955968 elif mapped_ty .c_ty == "uint16_t" or mapped_ty .c_ty == "int16_t" :
956969 return "const " + conv_name + ": Uint16Array = bindings.decodeUint16Array(" + arr_name + ");"
970+ elif mapped_ty .c_ty == "uint32_t" or mapped_ty .c_ty == "int32_t" :
971+ return "const " + conv_name + ": Uint32Array = bindings.decodeUint32Array(" + arr_name + ");"
957972 elif mapped_ty .c_ty == "int64_t" :
958973 return "const " + conv_name + ": BigInt64Array = bindings.decodeInt64Array(" + arr_name + ");"
959974 elif mapped_ty .c_ty == "uint64_t" :
0 commit comments