Merge pull request #6754 from danvk/master

nosafe param to Emscripten Module.getValue is optional
This commit is contained in:
Masahiro Wakame
2015-11-16 23:47:56 +09:00
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -11,6 +11,8 @@ function ModuleTest(): void {
var myTypedArray = new Uint8Array(10);
var buf = Module._malloc(myTypedArray.length*myTypedArray.BYTES_PER_ELEMENT);
Module.setValue(buf, 10, 'i32');
var x = Module.getValue(buf, 'i32') + 123;
Module.HEAPU8.set(myTypedArray, buf);
Module.ccall('my_function', 'number', ['number'], [buf]);
Module._free(buf);
+2 -2
View File
@@ -22,8 +22,8 @@ declare module Module {
function ccall(ident: string, returnType: string, argTypes: string[], args: any[]): any;
function cwrap(ident: string, returnType: string, argTypes: string[]): any;
function setValue(ptr: number, value: any, type: string, noSafe: boolean): void;
function getValue(ptr: number, type: string, noSafe: boolean): any;
function setValue(ptr: number, value: any, type: string, noSafe?: boolean): void;
function getValue(ptr: number, type: string, noSafe?: boolean): number;
var ALLOC_NORMAL: number;
var ALLOC_STACK: number;