On 21 November 2013 at 14:37, Alessandro Mammana wrote:
| I found out what the problem was, luckily it was just a stupid bug in
| my code (an array index out of bounds).
| I still didn't quite get how memory allocation works. As far as I
| understood there are these two ways of allocating memory:
I found out what the problem was, luckily it was just a stupid bug in
my code (an array index out of bounds).
I still didn't quite get how memory allocation works. As far as I
understood there are these two ways of allocating memory:
1. Using malloc/free, new/delete, normal C++ constructors and
de
On 20 November 2013 at 18:54, Alessandro Mammana wrote:
| Thanks a lot for your help, I'll look at the references. I saw Section
| 6.1.2 already. Does that mean that I should replace all the calls to
| malloc() and to free() with those to Calloc() and Free() in the
| external C code (maybe with a
Thanks a lot for your help, I'll look at the references. I saw Section
6.1.2 already. Does that mean that I should replace all the calls to
malloc() and to free() with those to Calloc() and Free() in the
external C code (maybe with a macro?)? Or does it just mean that I
would get the same memory e
Also, see the section in R-exts on debugging compiled code:
http://cran.r-project.org/doc/manuals/R-exts.html#Debugging-compiled-code
gdb can often point you either at, or close to, the code causing the
segfault, which helps to narrow the search.
-Kevin
On Wed, Nov 20, 2013 at 9:35 AM, Dirk Edde
On 20 November 2013 at 18:27, Alessandro Mammana wrote:
| Dear all,
| I'm trying to write some efficient code for analyzing sequencing data
| in R. To do this I would like to use the C library samtools. I've
| created a package where the src directory looks like this:
|
| src
| |-- Makevars
| |--
Without seeing your code, this is a lot like playing 20 questions, but
if your C code is correct, you
might get memory-related segfaults by misunderstanding the lifetime of
the R objects Rcpp references.
Krzysztof
On Wed, Nov 20, 2013 at 12:27 PM, Alessandro Mammana
wrote:
> Dear all,
> I'm tryi