Skip to content

Commit c18854f

Browse files
committed
---
yaml --- r: 6668 b: refs/heads/master c: a98dec0 h: refs/heads/master v: v3
1 parent b9b914e commit c18854f

File tree

5 files changed

+31
-17
lines changed

5 files changed

+31
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 548fe0eda9200104e39ad3ec5fcb9e0ea7e643a0
2+
refs/heads/master: a98dec035f1f2ddce6efcf3c2f43884ef659cc0a

trunk/src/etc/get-snapshot.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,34 @@
33
import os, tarfile, hashlib, re, shutil, sys
44
from snapshot import *
55

6+
old_snapshot_files = {
7+
"linux": ["bin/rustc",
8+
"lib/libcore.so",
9+
"lib/libruststd.so",
10+
"lib/librustrt.so",
11+
"lib/librustllvm.so"],
12+
"macos": ["bin/rustc",
13+
"lib/libcore.dylib",
14+
"lib/libruststd.dylib",
15+
"lib/librustrt.dylib",
16+
"lib/librustllvm.dylib"],
17+
"winnt": ["bin/rustc.exe",
18+
"lib/core.dll",
19+
"lib/ruststd.dll",
20+
"lib/rustrt.dll",
21+
"lib/rustllvm.dll"]
22+
}
23+
624
def unpack_snapshot(triple, snap):
725
dl_path = os.path.join(download_dir_base, snap)
826
print("opening snapshot " + dl_path)
927
tar = tarfile.open(dl_path)
1028
kernel = get_kernel(triple)
11-
for p in tar.getnames():
12-
name = p.replace("rust-stage0/", "", 1);
29+
for name in old_snapshot_files[kernel]:
30+
p = "rust-stage0/" + name
1331
stagep = os.path.join(triple, "stage0")
1432
fp = os.path.join(stagep, name)
15-
print("extracting " + p)
33+
print("extracting " + fp)
1634
tar.extract(p, download_unpack_base)
1735
tp = os.path.join(download_unpack_base, p)
1836
shutil.move(tp, fp)

trunk/src/rt/memory_region.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#include "memory_region.h"
33

44
#if RUSTRT_TRACK_ALLOCATIONS >= 1
5-
# define PTR_SIZE (sizeof(void*))
5+
// For some platforms, 16 byte alignment is required.
6+
# define PTR_SIZE 16
67
# define ALIGN_PTR(x) (((x)+PTR_SIZE-1)/PTR_SIZE*PTR_SIZE)
78
# define HEADER_SIZE ALIGN_PTR(sizeof(alloc_header))
89
# define MAGIC 0xbadc0ffe
@@ -65,11 +66,15 @@ memory_region::realloc(void *mem, size_t orig_size) {
6566
}
6667

6768
alloc_header *alloc = get_header(mem);
69+
# if RUSTRT_TRACK_ALLOCATIONS >= 1
70+
assert(alloc->magic == MAGIC);
71+
# endif
72+
6873
size_t size = orig_size + HEADER_SIZE;
6974
alloc_header *newMem = (alloc_header *)_srv->realloc(alloc, size);
7075

7176
# if RUSTRT_TRACK_ALLOCATIONS >= 1
72-
assert(alloc->magic == MAGIC);
77+
assert(newMem->magic == MAGIC);
7378
newMem->size = orig_size;
7479
# endif
7580

@@ -141,7 +146,7 @@ memory_region::~memory_region() {
141146
alloc_header *header = (alloc_header*)_allocation_list[i];
142147
printf("allocation (%s) 0x%" PRIxPTR " was not freed\n",
143148
header->tag,
144-
(uintptr_t) &header->data);
149+
(uintptr_t) get_data(header));
145150
++leak_count;
146151
}
147152
}
@@ -167,7 +172,7 @@ memory_region::release_alloc(void *mem) {
167172
if (_synchronized) { _lock.lock(); }
168173
if (_allocation_list[alloc->index] != alloc) {
169174
printf("free: ptr 0x%" PRIxPTR " (%s) is not in allocation_list\n",
170-
(uintptr_t) &alloc->data, alloc->tag);
175+
(uintptr_t) get_data(alloc), alloc->tag);
171176
_srv->fatal("not in allocation_list", __FILE__, __LINE__, "");
172177
}
173178
else {
@@ -222,6 +227,5 @@ memory_region::maybe_poison(void *mem) {
222227
// indent-tabs-mode: nil
223228
// c-basic-offset: 4
224229
// buffer-file-coding-system: utf-8-unix
225-
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
226230
// End:
227231
//

trunk/src/rt/memory_region.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ inline void *operator new(size_t size, memory_region *region,
8080
// indent-tabs-mode: nil
8181
// c-basic-offset: 4
8282
// buffer-file-coding-system: utf-8-unix
83-
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
8483
// End:
8584
//
8685

trunk/src/snapshots.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
S 2011-12-12 1c1bc2f
2-
winnt-i386 550dc539e8ab6837c52b3a35e6119061490190b1
3-
linux-i386 66c5e97e3072d8c88a52d986d1fadbd43de615a5
4-
macos-i386 c3db65606d7bbea2ae0482b20e177f7463dc58ef
5-
linux-x86_64 c5bbd08e423844ee938c8f6824ba2b3b4dc851b0
6-
macos-x86_64 29accda0ace162169408357371482ddd044b6dd3
7-
81
S 2011-12-07 3ccdd2a
92
linux-i386 7c639851d8a4ae43f781ad4592b6d3b6e0f4837b
103
macos-i386 8fdf95481943aff1953d93eed31528c221d33373

0 commit comments

Comments
 (0)