Skip to content

Commit be85b34

Browse files
Abseil Teamcopybara-github
authored andcommitted
Add Support for mmap on Qualcomm Hexagon DSP targets.
PiperOrigin-RevId: 548709037 Change-Id: I6eb03553299265660aa0abc180ae0f197a416ba4
1 parent 5938263 commit be85b34

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

absl/base/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
412412
defined(__asmjs__) || defined(__wasm__) || defined(__Fuchsia__) || \
413413
defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) || \
414414
defined(__HAIKU__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
415-
defined(__QNX__) || defined(__VXWORKS__)
415+
defined(__QNX__) || defined(__VXWORKS__) || defined(__hexagon__)
416416
#define ABSL_HAVE_MMAP 1
417417
#endif
418418

absl/base/internal/low_level_alloc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include "absl/base/internal/spinlock.h"
5959

6060
// MAP_ANONYMOUS
61-
#if defined(__APPLE__)
61+
#if defined(__APPLE__) || defined(__hexagon__)
6262
// For mmap, Linux defines both MAP_ANONYMOUS and MAP_ANON and says MAP_ANON is
6363
// deprecated. In Darwin, MAP_ANON is all there is.
6464
#if !defined MAP_ANONYMOUS

absl/base/internal/low_level_alloc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
// for more information.
4747
#ifdef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING
4848
#error ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING cannot be directly set
49-
#elif defined(_WIN32) || defined(__asmjs__) || defined(__wasm__)
49+
#elif defined(_WIN32) || defined(__asmjs__) || defined(__wasm__) || \
50+
defined(__hexagon__)
5051
#define ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING 1
5152
#endif
5253

absl/synchronization/internal/graphcycles.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include <algorithm>
3939
#include <array>
40+
#include <cinttypes>
4041
#include <limits>
4142
#include "absl/base/internal/hide_ptr.h"
4243
#include "absl/base/internal/raw_logging.h"
@@ -386,19 +387,22 @@ bool GraphCycles::CheckInvariants() const {
386387
Node* nx = r->nodes_[x];
387388
void* ptr = base_internal::UnhidePtr<void>(nx->masked_ptr);
388389
if (ptr != nullptr && static_cast<uint32_t>(r->ptrmap_.Find(ptr)) != x) {
389-
ABSL_RAW_LOG(FATAL, "Did not find live node in hash table %u %p", x, ptr);
390+
ABSL_RAW_LOG(FATAL, "Did not find live node in hash table %" PRIu32 " %p",
391+
x, ptr);
390392
}
391393
if (nx->visited) {
392-
ABSL_RAW_LOG(FATAL, "Did not clear visited marker on node %u", x);
394+
ABSL_RAW_LOG(FATAL, "Did not clear visited marker on node %" PRIu32, x);
393395
}
394396
if (!ranks.insert(nx->rank)) {
395-
ABSL_RAW_LOG(FATAL, "Duplicate occurrence of rank %d", nx->rank);
397+
ABSL_RAW_LOG(FATAL, "Duplicate occurrence of rank %" PRId32, nx->rank);
396398
}
397399
HASH_FOR_EACH(y, nx->out) {
398400
Node* ny = r->nodes_[static_cast<uint32_t>(y)];
399401
if (nx->rank >= ny->rank) {
400-
ABSL_RAW_LOG(FATAL, "Edge %u->%d has bad rank assignment %d->%d", x, y,
401-
nx->rank, ny->rank);
402+
ABSL_RAW_LOG(FATAL,
403+
"Edge %" PRIu32 " ->%" PRId32
404+
" has bad rank assignment %" PRId32 "->%" PRId32,
405+
x, y, nx->rank, ny->rank);
402406
}
403407
}
404408
}

0 commit comments

Comments
 (0)