Displaying 2 results from an estimated 2 matches for "__n__".
Did you mean:
_____
2010 Apr 21
2
suggestion how to use memcpy in duplicate.c
...c (once).
For the DUPLICATE_ATOMIC_VECTOR macro there is already a comment next to it
:
<FIXME>: surely memcpy would be faster here?
which seems to refer to the for loop :
else { \
int __i__; \
type *__fp__ = fun(from), *__tp__ = fun(to); \
for (__i__ = 0; __i__ < __n__; __i__++) \
__tp__[__i__] = __fp__[__i__]; \
} \
Could that loop be replaced by the following ?
else { \
memcpy((char *)DATAPTR(to), (char *)DATAPTR(from), __n__*sizeof(type)); \
}\
In the data.table package, dogroups.c uses this technique, so the principle
is tested and works...
2010 Jan 07
1
Segfault in GetNewPage, memory.c.
...REE_NODE(node_class, s);
> (gdb)
>
> Program received signal SIGSEGV, Segmentation fault.
> GetNewPage (node_class=1) at memory.c:657
> 657 SNAP_NODE(s, base);
> (gdb)
So CLASS_GET_FREE_NODE is #defined in memory.c as:
> #define CLASS_GET_FREE_NODE(c,s) do { \
> SEXP __n__ = R_GenHeap[c].Free; \
> if (__n__ == R_GenHeap[c].New) { \
> GetNewPage(c); \
> __n__ = R_GenHeap[c].Free; \
> } \
> R_GenHeap[c].Free = NEXT_NODE(__n__); \
> R_NodesInUse++; \
> (s) = __n__; \
> } while (0)
and we here have a call to GetNewPage.
> yz...