Skip to content

Memory allocation

3 messages · Gabriel Margarido, Duncan Murdoch, Keith Ponting

#
On 1/16/2009 12:46 PM, Gabriel Margarido wrote:
I believe this will do less copying, but I haven't profiled it to be 
sure.  Replace the last three lines with this one statement:

structure(list(..., bigarray=bigarray, ...),
                    class = "myfunc")

If that doesn't help, then you really need to determine where the 
copying is happening: you can use Rprofmem() to do that.


Duncan Murdoch
2 days later
#
Gabriel Margarido <gramarga <at> gmail.com> writes:
I solved similar problems using the R.oo package, which emulates
pass-by-reference semantics in 'R'.

HTH

Keith