hphp/runtime/vm/runtime.cpp
StringData* concat_ss(StringData* v1, StringData* v2) {
  if (v1->cowCheck()) {
    FOLLY_SDT(hhvm, hhvm_cow_concat, v1->size(), v2->size());
    StringData* ret = StringData::Make(v1, v2);
    // Because v1 was shared, we know this won't release the string.
    v1->decRefCount();
    return ret;
  }

  auto const rhs = v2->slice();
  UNUSED auto const lsize = v1->size();
  FOLLY_SDT(hhvm, hhvm_mut_concat, lsize, rhs.size());
  auto const ret = v1->append(rhs);
  if (UNLIKELY(ret != v1)) {
    // had to realloc even though count==1
    assertx(v1->hasExactlyOneRef());
    v1->release();
  }
  return ret;
}
/**
 * concat_ss will will incRef the output string
 * and decref its first argument
 */
concat_ss will will incRef the output string
and decref its first argument
concat_ss will will incRef the output string and decref its first argument
StringData* concat_ss(StringData* v1, StringData* v2) {
  if (v1->cowCheck()) {
    FOLLY_SDT(hhvm, hhvm_cow_concat, v1->size(), v2->size());
    StringData* ret = StringData::Make(v1, v2);
    v1->decRefCount();
    return ret;
  }
  auto const rhs = v2->slice();
  UNUSED auto const lsize = v1->size();
  FOLLY_SDT(hhvm, hhvm_mut_concat, lsize, rhs.size());
  auto const ret = v1->append(rhs);
  if (UNLIKELY(ret != v1)) {
    assertx(v1->hasExactlyOneRef());
    v1->release();
  }
  return ret;
}
StringData * concat_ss ( StringData * v1 , StringData * v2 ) { if ( v1 -> cowCheck ( ) ) { FOLLY_SDT ( hhvm , hhvm_cow_concat , v1 -> size ( ) , v2 -> size ( ) ) ; StringData * ret = StringData :: Make ( v1 , v2 ) ; v1 -> decRefCount ( ) ; return ret ; } auto const rhs = v2 -> slice ( ) ; UNUSED auto const lsize = v1 -> size ( ) ; FOLLY_SDT ( hhvm , hhvm_mut_concat , lsize , rhs . size ( ) ) ; auto const ret = v1 -> append ( rhs ) ; if ( UNLIKELY ( ret != v1 ) ) { assertx ( v1 -> hasExactlyOneRef ( ) ) ; v1 -> release ( ) ; } return ret ; }
concat_ss will will incRef the output string
 and decref its first argument
concat_ss will will incRef the output string and decref its first argument
// Because v1 was shared, we know this won't release the string. // had to realloc even though count==1