diff --git a/Makefile b/Makefile index e8fc413e..3fabb5ae 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ JS_ASMJS_TARGET := javascript/olm_legacy.js WASM_TARGET := $(BUILD_DIR)/wasm/libolm.a JS_EXPORTED_FUNCTIONS := javascript/exported_functions.json -JS_EXPORTED_RUNTIME_METHODS := [ALLOC_STACK,writeAsciiToMemory,intArrayFromString,UTF8ToString,stringToUTF8] +JS_EXPORTED_RUNTIME_METHODS := [stackAlloc,writeAsciiToMemory,intArrayFromString,UTF8ToString,stringToUTF8] JS_EXTERNS := javascript/externs.js PUBLIC_HEADERS := include/olm/olm.h include/olm/outbound_group_session.h include/olm/inbound_group_session.h include/olm/pk.h include/olm/sas.h include/olm/error.h include/olm/olm_export.h @@ -93,7 +93,7 @@ LDFLAGS += -Wall -Werror CFLAGS_NATIVE = -fPIC CXXFLAGS_NATIVE = -fPIC -EMCCFLAGS = --closure 1 --memory-init-file 0 -s NO_FILESYSTEM=1 -s INVOKE_RUN=0 -s MODULARIZE=1 -Wno-error=closure +EMCCFLAGS = -O2 --closure 1 -s NO_FILESYSTEM=1 -s INVOKE_RUN=0 -s MODULARIZE=1 -Wno-error=closure # Olm generally doesn't need a lot of memory to encrypt / decrypt its usual # payloads (ie. Matrix messages), but we do need about 128K of heap to encrypt diff --git a/include/olm/list.hh b/include/olm/list.hh index 6906c878..e8f3b7ca 100644 --- a/include/olm/list.hh +++ b/include/olm/list.hh @@ -99,7 +99,7 @@ public: return *this; } T * this_pos = _data; - T * const other_pos = other._data; + T const * other_pos = other._data; while (other_pos != other._end) { *this_pos = *other; ++this_pos;