Update memset to use prealloc