I suggest for consistency to handle fully zeroed-out uvwasi passed to uvwasi_destroy. That would simplify client-side in that you wouldn't need to check whether uvwasi_init finished successfully when you call uvwasi_destroy.
P.S. Not sure if it would also make sense to add uvwasi->allocator = NULL; to uvwasi_destroy.
uvwasi_destroy
currently handles the case when NULL is passed asuvwasi
https://github.com/nodejs/uvwasi/blob/adda15515cbb5a478d0ddb85602d987278a43384/src/uvwasi.c#L372-L373 and also whenuvwasi->fds
is NULL https://github.com/nodejs/uvwasi/blob/adda15515cbb5a478d0ddb85602d987278a43384/src/fd_table.c#L231-L232 but not the case whenuvwasi->allocator
is NULL.I suggest for consistency to handle fully zeroed-out
uvwasi
passed touvwasi_destroy
. That would simplify client-side in that you wouldn't need to check whetheruvwasi_init
finished successfully when you calluvwasi_destroy
.P.S. Not sure if it would also make sense to add
uvwasi->allocator = NULL;
touvwasi_destroy
.