Skip to content

Commit 1d69693

Browse files
committed
---
yaml --- r: 140486 b: refs/heads/try2 c: ce45f39 h: refs/heads/master v: v3
1 parent 453c5ee commit 1d69693

File tree

3 files changed

+3
-31
lines changed

3 files changed

+3
-31
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 8b32bde408bb6fdf6fcf4e7c2727fff3a31dd8b1
8+
refs/heads/try2: ce45f390dd55fbd8ebaf1be07ad1b3b3bb5d2f4d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/cleanup.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ fn debug_mem() -> bool {
167167
#[cfg(notest)]
168168
#[lang="annihilate"]
169169
pub unsafe fn annihilate() {
170-
use unstable::lang::{local_free};
171-
use unstable::lang;
170+
use unstable::lang::local_free;
172171
use io::WriterUtil;
173172
use io;
174173
use libc;
@@ -192,10 +191,8 @@ pub unsafe fn annihilate() {
192191
for each_live_alloc(true) |box, uniq| {
193192
stats.n_total_boxes += 1;
194193
if uniq {
195-
lang::debug_mem("Managed-uniq: ", &*box);
196194
stats.n_unique_boxes += 1;
197195
} else {
198-
lang::debug_mem("Immortalizing: ", &*box);
199196
(*box).header.ref_count = managed::raw::RC_IMMORTAL;
200197
}
201198
}
@@ -207,13 +204,9 @@ pub unsafe fn annihilate() {
207204
// callback, as the original value may have been freed.
208205
for each_live_alloc(false) |box, uniq| {
209206
if !uniq {
210-
lang::debug_mem("Invoking tydesc/glue on: ", &*box);
211207
let tydesc: *TypeDesc = transmute(copy (*box).header.type_desc);
212208
let drop_glue: DropGlue = transmute(((*tydesc).drop_glue, 0));
213-
lang::debug_mem("Box data: ", &(*box).data);
214-
lang::debug_mem("Type descriptor: ", tydesc);
215209
drop_glue(to_unsafe_ptr(&tydesc), transmute(&(*box).data));
216-
lang::debug_mem("Dropped ", &*box);
217210
}
218211
}
219212

@@ -225,7 +218,6 @@ pub unsafe fn annihilate() {
225218
// not be valid after.
226219
for each_live_alloc(true) |box, uniq| {
227220
if !uniq {
228-
lang::debug_mem("About to free: ", &*box);
229221
stats.n_bytes_freed +=
230222
(*((*box).header.type_desc)).size
231223
+ sys::size_of::<BoxRepr>();

branches/try2/src/libcore/unstable/lang.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -153,32 +153,13 @@ unsafe fn fail_borrowed(box: *mut BoxRepr, file: *c_char, line: size_t) {
153153
#[lang="exchange_malloc"]
154154
#[inline(always)]
155155
pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
156-
let result = transmute(exchange_alloc::malloc(transmute(td), transmute(size)));
157-
debug_mem("exchange_malloc: ", result);
158-
return result;
156+
transmute(exchange_alloc::malloc(transmute(td), transmute(size)))
159157
}
160158

161159
/// Because this code is so perf. sensitive, use a static constant so that
162160
/// debug printouts are compiled out most of the time.
163161
static ENABLE_DEBUG: bool = false;
164162

165-
#[inline]
166-
pub fn debug_mem<T>(tag: &'static str, p: *const T) {
167-
//! A useful debugging function that prints a pointer + tag + newline
168-
//! without allocating memory.
169-
170-
if ENABLE_DEBUG && ::rt::env::get().debug_mem {
171-
debug_mem_slow(tag, p);
172-
}
173-
174-
fn debug_mem_slow<T>(tag: &'static str, p: *const T) {
175-
let dbg = STDERR_FILENO as io::fd_t;
176-
dbg.write_str(tag);
177-
dbg.write_hex(p as uint);
178-
dbg.write_str("\n");
179-
}
180-
}
181-
182163
#[inline]
183164
unsafe fn debug_borrow<T>(tag: &'static str,
184165
p: *const T,
@@ -252,7 +233,6 @@ impl DebugPrints for io::fd_t {
252233
#[lang="exchange_free"]
253234
#[inline(always)]
254235
pub unsafe fn exchange_free(ptr: *c_char) {
255-
debug_mem("exchange_free: ", ptr);
256236
exchange_alloc::free(transmute(ptr))
257237
}
258238

0 commit comments

Comments
 (0)