diff options
| author | Marijn Haverbeke <[email protected]> | 2011-04-07 22:05:45 +0200 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-04-07 15:15:30 -0700 |
| commit | 9a7576fe2cdd169313b5e25be6bf485407adb496 (patch) | |
| tree | 36f5c9a5baaae95be1fb3cdc9b5b76814b08e803 /src/rt/rust_port.cpp | |
| parent | rustc: Pointer cast when autodereferencing boxed tag types (diff) | |
| download | rust-9a7576fe2cdd169313b5e25be6bf485407adb496.tar.xz rust-9a7576fe2cdd169313b5e25be6bf485407adb496.zip | |
Move to macro-based logging checks in the C++ code
No functions should be called for log statements that turn out to be
inactive.
Diffstat (limited to 'src/rt/rust_port.cpp')
| -rw-r--r-- | src/rt/rust_port.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp index 82054687..178b46a7 100644 --- a/src/rt/rust_port.cpp +++ b/src/rt/rust_port.cpp @@ -5,7 +5,7 @@ rust_port::rust_port(rust_task *task, size_t unit_sz) : maybe_proxy<rust_port>(this), task(task), unit_sz(unit_sz), writers(task->dom), chans(task->dom) { - task->log(rust_log::MEM | rust_log::COMM, + LOG(task, rust_log::MEM | rust_log::COMM, "new rust_port(task=0x%" PRIxPTR ", unit_sz=%d) -> port=0x%" PRIxPTR, (uintptr_t)task, unit_sz, (uintptr_t)this); @@ -14,10 +14,10 @@ rust_port::rust_port(rust_task *task, size_t unit_sz) : } rust_port::~rust_port() { - task->log(rust_log::COMM | rust_log::MEM, + LOG(task, rust_log::COMM | rust_log::MEM, "~rust_port 0x%" PRIxPTR, (uintptr_t) this); - log_state(); + // log_state(); // Disassociate channels from this port. while (chans.is_empty() == false) { @@ -25,7 +25,7 @@ rust_port::~rust_port() { chan->disassociate(); if (chan->ref_count == 0) { - task->log(rust_log::COMM, + LOG(task, rust_log::COMM, "chan: 0x%" PRIxPTR " is dormant, freeing", chan); delete chan; } @@ -39,7 +39,7 @@ bool rust_port::receive(void *dptr) { rust_chan *chan = chans[i]; if (chan->buffer.is_empty() == false) { chan->buffer.dequeue(dptr); - task->log(rust_log::COMM, "<=== read data ==="); + LOG(task, rust_log::COMM, "<=== read data ==="); return true; } } @@ -47,12 +47,12 @@ bool rust_port::receive(void *dptr) { } void rust_port::log_state() { - task->log(rust_log::COMM, + LOG(task, rust_log::COMM, "rust_port: 0x%" PRIxPTR ", associated channel(s): %d", this, chans.length()); for (uint32_t i = 0; i < chans.length(); i++) { rust_chan *chan = chans[i]; - task->log(rust_log::COMM, + LOG(task, rust_log::COMM, "\tchan: 0x%" PRIxPTR ", size: %d, remote: %s", chan, chan->buffer.size(), |