Skip to content

Commit 40aa828

Browse files
committed
---
yaml --- r: 59367 b: refs/heads/snap-stage3 c: ce45f39 h: refs/heads/master i: 59365: 32847a2 59363: 3110d09 59359: a94ed9e v: v3
1 parent cc2a6a8 commit 40aa828

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 8b32bde408bb6fdf6fcf4e7c2727fff3a31dd8b1
4+
refs/heads/snap-stage3: ce45f390dd55fbd8ebaf1be07ad1b3b3bb5d2f4d
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)