[vector] #27: Zero out an unboxed array
vector
vector at projects.haskell.org
Wed Jul 14 03:43:19 EDT 2010
#27: Zero out an unboxed array
------------------------+---------------------------------------------------
Reporter: jbapple | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone:
Version: 0.6 | Keywords:
------------------------+---------------------------------------------------
For all of the unboxed types, 0 makes sense as a value, and can be
represented by bytes with no bits set. Initializing a Vector someType
using newWith, however, sets each group of bits or bytes one someType at a
time. I suspect memset would be substantially faster.
I suggest, for unboxed types only, an initializer named something like
newZero. This might work for Storable as well.
Because newWith is slower than I would like, I am using new rather than
newWith and using [http://research.swtch.com/2008/03/using-uninitialized-
memory-for-fun-and.html a trick] to make sure I don't actually use any
uninitialized values.
--
Ticket URL: <http://trac.haskell.org/vector/ticket/27>
vector <http://trac.haskell.org/vector>
Package vector
More information about the vector
mailing list