RE: [Rd] memory allocation questions

From: <Mark.Bravington_at_csiro.au>
Date: Wed 15 Sep 2004 - 08:47:31 EST


Thanks both

All seems to work now, whether I use R_chk_alloc etc. (as per RS.h) or the Delphi routines. Sounds like I might as well stick with the latter though, since I have to do the housekeeping anyway.

Mark

#>should I bother using the R [memory allocation] routines instead [of the Delphi built-ins]?
#
#There is not much reason to need to use the R routines. The
#disadvantages of using Delphi allocation are:
#
# - Your allocations won't be automatically deleted by the garbage
#collector (but neither are those of Calloc, you need R_alloc for that)
# - If allocation fails, it will be up to you to detect that and deal
#with it.
#
#The disadvantage of using the R routines Calloc etc. is that
# - You need to translate C macros to Delphi.
# - You need to worry about whether the RS.h file has changed with
#each release (but the Calloc etc. macros are likely to be very stable,
#they haven't changed since 2000).
#
#Duncan Murdoch
#

#> if I do use the R replacements, what are their names nowadays?
#
#> R-EXTS refers to Calloc, Realloc and Free, but these aren't exported by
#> R.DLL (for R1.9.0 or 1.9.1) and I couldn't find mention of any name
#> change in the NEWS file.
#
#There is no change. R-exts does say you must include the appropriate
#headers, in this case include/R_ext/RS.h. They are defines, and not just
#simple calls to entry points. I'll leave you to take a closer look.
#
#--
#Brian D. Ripley, ripley@stats.ox.ac.uk



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Sep 15 08:52:25 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:15 EST