search for: sexprec_align

Displaying 4 results from an estimated 4 matches for "sexprec_align".

2004 Apr 13
1
shared mem advice
...IPC_CREAT); shared = (SEXP) shmat(shared_mem_id, (void *)0, 0); my_allocVector(SEXPTYPE type, int length, SEXP shared) { SEXP s=shared; .... And erase this if: ################################################# if(size >= (LONG_MAX / sizeof(VECREC))-sizeof(SEXPREC_ALIGN) || (s = malloc(sizeof(SEXPREC_ALIGN) + size * sizeof(VECREC)) ) == NULL) { { ################################################# Alex
2005 Mar 10
1
R_alloc with more than 2GB (PR#7721)
...long nelem, int eltsize) { R_size_t size = nelem * eltsize; SEXP s = allocString(size); ... } SEXP allocString(int length) { return allocVector(CHARSXP, length); } SEXP allocVector(SEXPTYPE type, R_len_t length) { ... case CHARSXP: size = BYTE2VEC(length + 1); ... malloc(sizeof(SEXPREC_ALIGN) + size * sizeof(VECREC))) ... }
2013 Aug 29
2
Why does an empty vector occupy 40 bytes?
Hi all, Why is the object size of an empty vector 40 bytes? (At least in 64-bit R.) object.size(integer(0)) # 40 bytes Reading R internals, it looks like it should be: * 4 bytes: sxpinfo header (= 32 bits) * 8 bytes: pointer to attributes * 8 bytes: pointer to next node * 8 bytes: pointer to previous node * 4 bytes: length * 4 bytes: true length = 36 bytes Where are the extra 4 bytes coming
2011 Aug 14
0
Improved version of Rprofmem
...R_GenHeap[node_class].pages = page; R_GenHeap[node_class].PageCount++; @@ -2312,6 +2317,13 @@ } } + if (R_IsMemReporting) { + if (!R_MemPagesReporting + || size > 0 && node_class >= NUM_SMALL_NODE_CLASSES) + R_ReportAllocation (sizeof(SEXPREC_ALIGN) + size * sizeof(VECREC), + type, length); + } + /* save current R_VSize to roll back adjustment if malloc fails */ old_R_VSize = R_VSize; @@ -2351,9 +2363,6 @@ s = malloc(sizeof(SEXPREC_ALIGN) + size * sizeof(VECREC)); } if (s != NULL) suc...