On Mon, Jun 11, 2012 at 11:30 AM, Joshua Bell <email@example.com>
For handling arbitrary encoded string terminators we discussed exposing memchr() on views (as an indexOf() method) over on whatwg. Any other mem* primitives that we should consider?
I think memchr (+ memrchr) and memcmp is it.Â We already have memset and memcpy (TypedArray#set), and that covers all of the important ones.
memchr and memrchr should be indexOf/lastIndexOf functions on TypedArray (eg. Uint16Array#indexOf(0) to find a null-terminator in a UTF-16 string), but memcmp can probably just work on the raw underlying data (like memcmp itself--avoiding the complexity of crossing types) and live on ArrayBufferView.