OSX warnings (last batch to enable 4.7.1 warnings)
- fix last batch of warnings
Esse commit está contido em:
@@ -1397,7 +1397,7 @@ ArrayData* HphpArray::nvNew(TypedValue*& ret, bool copy) {
|
||||
// nvGetKey does not touch out->_count, so can be used
|
||||
// for inner or outer cells.
|
||||
void HphpArray::NvGetKeyVec(const ArrayData* ad, TypedValue* out, ssize_t pos) {
|
||||
auto a = asVector(ad);
|
||||
DEBUG_ONLY auto a = asVector(ad);
|
||||
assert(pos != ArrayData::invalid_index);
|
||||
assert(!isTombstone(a->m_data[pos].data.m_type));
|
||||
out->m_data.num = pos;
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "hphp/util/timer.h"
|
||||
#include "hphp/util/trace.h"
|
||||
#include "hphp/util/meta.h"
|
||||
#include "hphp/util/process.h"
|
||||
#include "hphp/util/util.h"
|
||||
#include "hphp/util/repo_schema.h"
|
||||
#include "hphp/util/cycles.h"
|
||||
@@ -3824,7 +3825,7 @@ TranslatorX64::requestExit() {
|
||||
}
|
||||
TRACE_MOD(txlease, 2, "%" PRIx64 " write lease stats: %15" PRId64
|
||||
" kept, %15" PRId64 " grabbed\n",
|
||||
pthread_self(), s_writeLease.m_hintKept,
|
||||
Process::GetThreadIdForTrace(), s_writeLease.m_hintKept,
|
||||
s_writeLease.m_hintGrabbed);
|
||||
PendQ::drain();
|
||||
Treadmill::finishRequest(g_vmContext->m_currentThreadIdx);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
#include "hphp/runtime/vm/jit/write-lease.h"
|
||||
#include "hphp/util/process.h"
|
||||
#include "hphp/util/timer.h"
|
||||
#include "hphp/runtime/vm/bytecode.h"
|
||||
#include "hphp/runtime/vm/jit/translator.h"
|
||||
@@ -77,7 +78,7 @@ bool Lease::acquire(bool blocking /* = false */ ) {
|
||||
pthread_mutex_lock(&m_lock) :
|
||||
pthread_mutex_trylock(&m_lock))) {
|
||||
TRACE(4, "thr%" PRIx64 ": acquired lease, called by %p,%p\n",
|
||||
pthread_self(), __builtin_return_address(0),
|
||||
Process::GetThreadIdForTrace(), __builtin_return_address(0),
|
||||
__builtin_return_address(1));
|
||||
if (debug) {
|
||||
pushRank(RankWriteLease);
|
||||
@@ -86,7 +87,7 @@ bool Lease::acquire(bool blocking /* = false */ ) {
|
||||
TRACE(3,
|
||||
"thr%" PRIx64 ": acquired hinted lease"
|
||||
", expired %" PRId64 "us ago\n",
|
||||
pthread_self(), -expireDiff);
|
||||
Process::GetThreadIdForTrace(), -expireDiff);
|
||||
} else if (expire != 0 && m_owner == pthread_self()) {
|
||||
m_hintKept++;
|
||||
}
|
||||
@@ -100,7 +101,7 @@ bool Lease::acquire(bool blocking /* = false */ ) {
|
||||
}
|
||||
if (blocking) {
|
||||
TRACE(3, "thr%" PRIx64 ": failed to acquired lease in blocking mode\n",
|
||||
pthread_self());
|
||||
Process::GetThreadIdForTrace());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +109,7 @@ bool Lease::acquire(bool blocking /* = false */ ) {
|
||||
void Lease::drop(int64_t hintExpireDelay) {
|
||||
assert(amOwner());
|
||||
TRACE(4, "thr%" PRIx64 ": dropping lease, called by %p,%p\n",
|
||||
pthread_self(), __builtin_return_address(0),
|
||||
Process::GetThreadIdForTrace(), __builtin_return_address(0),
|
||||
__builtin_return_address(1));
|
||||
if (debug) {
|
||||
popRank(RankWriteLease);
|
||||
|
||||
@@ -115,6 +115,21 @@ public:
|
||||
return pthread_self();
|
||||
}
|
||||
|
||||
/**
|
||||
* Current thread's identifier.
|
||||
*/
|
||||
static uint64_t GetThreadIdForTrace() {
|
||||
// For tracing purposes this just needs to be unique, pthread_t is not
|
||||
// portable but even if it's a pointer to a struct like on OSX this will
|
||||
// produce a unique value. If we support platforms where this isn't the
|
||||
// case we will need to revisit this.
|
||||
#ifdef __linux__
|
||||
return pthread_self();
|
||||
#else
|
||||
return (uint64_t)pthread_self();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Thread's process identifier.
|
||||
*/
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "hphp/util/base.h"
|
||||
#include "hphp/util/mutex.h"
|
||||
#include "hphp/util/process.h"
|
||||
|
||||
namespace HPHP {
|
||||
#ifdef DEBUG
|
||||
@@ -44,10 +45,10 @@ void checkRank(Rank r) {
|
||||
if (r == RankLeaf) {
|
||||
fprintf(stderr,
|
||||
"Rank violation in thr%" PRIx64 "! leaf lock from leaf rank; ",
|
||||
pthread_self());
|
||||
Process::GetThreadIdForTrace());
|
||||
} else {
|
||||
fprintf(stderr, "Rank violation in thr%" PRIx64 "! lock of rank %d; ",
|
||||
pthread_self(), r);
|
||||
Process::GetThreadIdForTrace(), r);
|
||||
}
|
||||
fprintf(stderr, "held locks:\n");
|
||||
for (int i = tl_curRankDepth - 1; i >= 0; --i) {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário