added size_t and also conditionally define GET_REF, R_createRef to allow other packages to override these easily.