added ref_count == UINT32_MAX special case