kripken/emscripten — Issue #255: _mmap problem...
Author: BabyRaptor
Created: 2012-02-15 07:16:16+00:00
State: open

I've encoutered a problem:

In library.js, function mmap is:
```
mmap: function(start, num, prot, flags, stream, offset) {
/* FIXME: Since mmap is normally implemented at the kernel level,
* this implementation simply uses malloc underneath the call to
* mmap.
*/
if (stream == -1) {
var ptr = _malloc(num);
_memset(ptr, 0, num);
return ptr;
}
var info = FS.streams[stream];
if (!info) return -1;
return allocate(info.object.contents.slice(offset, offset+num),
'i8', ALLOC_NORMAL);
}
```

And I encounter a problem that
```
info.object.contents
```
is a Uint8Array, and it has no method
```
slice
```

How will i solve this?
Thank you.