Skip to content

Commit c42492e

Browse files
committed
rt: Rename config_valgrind_stack to register_valgrind_stack, etc
1 parent dd0ae80 commit c42492e

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

src/rt/rust_stack.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@
33
#include "vg/valgrind.h"
44
#include "vg/memcheck.h"
55

6-
// A value that goes at the end of the stack and must not be touched
7-
const uint8_t stack_canary[] = {0xAB, 0xCD, 0xAB, 0xCD,
8-
0xAB, 0xCD, 0xAB, 0xCD,
9-
0xAB, 0xCD, 0xAB, 0xCD,
10-
0xAB, 0xCD, 0xAB, 0xCD};
11-
126
void
13-
config_valgrind_stack(stk_seg *stk) {
7+
register_valgrind_stack(stk_seg *stk) {
148
stk->valgrind_id =
159
VALGRIND_STACK_REGISTER(&stk->data[0],
1610
stk->end);
@@ -25,7 +19,7 @@ config_valgrind_stack(stk_seg *stk) {
2519
}
2620

2721
void
28-
unconfig_valgrind_stack(stk_seg *stk) {
22+
deregister_valgrind_stack(stk_seg *stk) {
2923
VALGRIND_STACK_DEREGISTER(stk->valgrind_id);
3024
}
3125

src/rt/rust_stack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ destroy_stack(T allocer, stk_seg *stk) {
4040
}
4141

4242
void
43-
config_valgrind_stack(stk_seg *stk);
43+
register_valgrind_stack(stk_seg *stk);
4444

4545
void
46-
unconfig_valgrind_stack(stk_seg *stk);
46+
deregister_valgrind_stack(stk_seg *stk);
4747

4848
void
4949
check_stack_canary(stk_seg *stk);

src/rt/rust_task.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ rust_task::new_stack(size_t requested_sz) {
567567
LOG(this, mem, "reusing existing stack");
568568
stk = stk->prev;
569569
A(thread, stk->prev == NULL, "Bogus stack ptr");
570-
config_valgrind_stack(stk);
570+
register_valgrind_stack(stk);
571571
return;
572572
} else {
573573
LOG(this, mem, "existing stack is not big enough");
@@ -598,7 +598,7 @@ rust_task::new_stack(size_t requested_sz) {
598598
LOGPTR(thread, "stk end", new_stk->end);
599599

600600
stk = new_stk;
601-
config_valgrind_stack(stk);
601+
register_valgrind_stack(stk);
602602
total_stack_sz += user_stack_size(new_stk);
603603
}
604604

@@ -626,7 +626,7 @@ rust_task::del_stack() {
626626
old_stk->prev = NULL;
627627
}
628628

629-
unconfig_valgrind_stack(old_stk);
629+
deregister_valgrind_stack(old_stk);
630630
if (delete_stack) {
631631
free_stack(old_stk);
632632
A(thread, total_stack_sz == 0, "Stack size should be 0");

src/rt/rust_task_thread.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ rust_task_thread::start_main_loop() {
290290

291291
I(this, !extra_c_stack);
292292
if (cached_c_stack) {
293-
unconfig_valgrind_stack(cached_c_stack);
293+
deregister_valgrind_stack(cached_c_stack);
294294
destroy_stack(kernel, cached_c_stack);
295295
cached_c_stack = NULL;
296296
}
@@ -372,14 +372,14 @@ rust_task_thread::prepare_c_stack() {
372372
I(this, !extra_c_stack);
373373
if (!cached_c_stack) {
374374
cached_c_stack = create_stack(kernel, C_STACK_SIZE);
375-
config_valgrind_stack(cached_c_stack);
375+
register_valgrind_stack(cached_c_stack);
376376
}
377377
}
378378

379379
void
380380
rust_task_thread::unprepare_c_stack() {
381381
if (extra_c_stack) {
382-
unconfig_valgrind_stack(extra_c_stack);
382+
deregister_valgrind_stack(extra_c_stack);
383383
destroy_stack(kernel, extra_c_stack);
384384
extra_c_stack = NULL;
385385
}

0 commit comments

Comments
 (0)