<div dir="ltr">Many thanks Bill and Dirk.<div><br></div><div>I'm now explicitly casting each element and this works fine. I was just surprised that this inappropriate use of wrap would cause a memory leak on certain OS's and run without problems on others.</div><div><br></div><div>Best wishes,</div><div><br></div><div>Rajen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 August 2016 at 10:18, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
To follow-up, if we avoid the cast this works just find as you'd expect:<br>
<br>
R> cppFunction("NumericVector myrunif() { return floor(runif(1000000)); }")<br>
R> for (i in 1:100) ignoreme <- myrunif()<br>
R><br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</div></div></blockquote></div><br></div>