rt: Fix whitespace

This commit is contained in:
Brian Anderson 2012-03-31 23:12:06 -07:00
parent cf0c4cd7d2
commit 21064637ed
20 changed files with 109 additions and 99 deletions

View File

@ -42,7 +42,6 @@ private:
inline alloc_header *get_header(void *mem); inline alloc_header *get_header(void *mem);
inline void *get_data(alloc_header *); inline void *get_data(alloc_header *);
rust_srv *_srv; rust_srv *_srv;
memory_region *_parent; memory_region *_parent;
int _live_allocations; int _live_allocations;

View File

@ -58,7 +58,8 @@ class annihilator : public shape::data<annihilator,shape::ptr> {
} }
void walk_tag2(shape::tag_info &tinfo, uint32_t tag_variant) { void walk_tag2(shape::tag_info &tinfo, uint32_t tag_variant) {
shape::data<annihilator,shape::ptr>::walk_variant1(tinfo, tag_variant); shape::data<annihilator,shape::ptr>
::walk_variant1(tinfo, tag_variant);
} }
void walk_uniq2() { void walk_uniq2() {

View File

@ -67,7 +67,8 @@ rust_kernel::create_scheduler(size_t num_threads) {
sched = new (this, "rust_scheduler") sched = new (this, "rust_scheduler")
rust_scheduler(this, srv, num_threads, id); rust_scheduler(this, srv, num_threads, id);
bool is_new = sched_table bool is_new = sched_table
.insert(std::pair<rust_sched_id, rust_scheduler*>(id, sched)).second; .insert(std::pair<rust_sched_id,
rust_scheduler*>(id, sched)).second;
A(this, is_new, "Reusing a sched id?"); A(this, is_new, "Reusing a sched id?");
} }
sched->start_task_threads(); sched->start_task_threads();

View File

@ -362,7 +362,8 @@ public:
void walk_fn2(char) { return cmp_two_pointers(); } void walk_fn2(char) { return cmp_two_pointers(); }
void walk_obj2() { return cmp_two_pointers(); } void walk_obj2() { return cmp_two_pointers(); }
void walk_tag2(tag_info &tinfo, const data_pair<tag_variant_t> &tag_variants); void walk_tag2(tag_info &tinfo,
const data_pair<tag_variant_t> &tag_variants);
void walk_struct2(const uint8_t *end_sp); void walk_struct2(const uint8_t *end_sp);
void walk_res2(const rust_fn *dtor, uint16_t n_ty_params, void walk_res2(const rust_fn *dtor, uint16_t n_ty_params,
const type_param *ty_params_sp, const uint8_t *end_sp, const type_param *ty_params_sp, const uint8_t *end_sp,
@ -400,7 +401,8 @@ cmp::walk_vec2(bool is_pod, const std::pair<ptr_pair,ptr_pair> &data_range) {
} }
void void
cmp::walk_tag2(tag_info &tinfo, const data_pair<tag_variant_t> &tag_variants) { cmp::walk_tag2(tag_info &tinfo,
const data_pair<tag_variant_t> &tag_variants) {
cmp_number(tag_variants); cmp_number(tag_variants);
if (result != 0) if (result != 0)
return; return;

View File

@ -1158,7 +1158,8 @@ private:
variant_ptr_and_end); variant_ptr_and_end);
void walk_string2(const std::pair<ptr,ptr> &data); void walk_string2(const std::pair<ptr,ptr> &data);
void walk_res2(const rust_fn *dtor, unsigned n_params, void walk_res2(const rust_fn *dtor, unsigned n_params,
const type_param *params, const uint8_t *end_sp, bool live); const type_param *params, const uint8_t *end_sp,
bool live);
template<typename T> template<typename T>
inline void walk_number2() { inline void walk_number2() {

View File

@ -44,7 +44,8 @@ rust_task::rust_task(rust_task_thread *thread, rust_task_state state,
supervisor(spawner) supervisor(spawner)
{ {
LOGPTR(thread, "new task", (uintptr_t)this); LOGPTR(thread, "new task", (uintptr_t)this);
DLOG(thread, task, "sizeof(task) = %d (0x%x)", sizeof *this, sizeof *this); DLOG(thread, task, "sizeof(task) = %d (0x%x)",
sizeof *this, sizeof *this);
new_stack(init_stack_sz); new_stack(init_stack_sz);
if (supervisor) { if (supervisor) {
@ -400,7 +401,8 @@ rust_task::wakeup(rust_cond *from) {
A(thread, cond != NULL, "Cannot wake up unblocked task."); A(thread, cond != NULL, "Cannot wake up unblocked task.");
LOG(this, task, "Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR, LOG(this, task, "Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR,
(uintptr_t) cond, (uintptr_t) from); (uintptr_t) cond, (uintptr_t) from);
A(thread, cond == from, "Cannot wake up blocked task on wrong condition."); A(thread, cond == from,
"Cannot wake up blocked task on wrong condition.");
transition(task_state_blocked, task_state_running, NULL, "none"); transition(task_state_blocked, task_state_running, NULL, "none");
} }

View File

@ -176,8 +176,8 @@ rust_task_thread::log_state() {
if (!blocked_tasks.is_empty()) { if (!blocked_tasks.is_empty()) {
log(NULL, log_debug, "blocked tasks:"); log(NULL, log_debug, "blocked tasks:");
for (size_t i = 0; i < blocked_tasks.length(); i++) { for (size_t i = 0; i < blocked_tasks.length(); i++) {
log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR ", blocked on: 0x%" log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR
PRIxPTR " '%s'", ", blocked on: 0x%" PRIxPTR " '%s'",
blocked_tasks[i]->name, blocked_tasks[i], blocked_tasks[i]->name, blocked_tasks[i],
blocked_tasks[i]->get_cond(), blocked_tasks[i]->get_cond(),
blocked_tasks[i]->get_cond_name()); blocked_tasks[i]->get_cond_name());

View File

@ -416,7 +416,8 @@ extern "C" void
upcall_cmp_type(int8_t *result, const type_desc *tydesc, upcall_cmp_type(int8_t *result, const type_desc *tydesc,
const type_desc **subtydescs, uint8_t *data_0, const type_desc **subtydescs, uint8_t *data_0,
uint8_t *data_1, uint8_t cmp_type) { uint8_t *data_1, uint8_t cmp_type) {
s_cmp_type_args args = {result, tydesc, subtydescs, data_0, data_1, cmp_type}; s_cmp_type_args args = {result, tydesc, subtydescs,
data_0, data_1, cmp_type};
UPCALL_SWITCH_STACK(&args, upcall_s_cmp_type); UPCALL_SWITCH_STACK(&args, upcall_s_cmp_type);
} }

View File

@ -95,7 +95,8 @@ vec_data(rust_vec *v) {
inline void reserve_vec_exact(rust_task* task, rust_vec** vpp, size_t size) { inline void reserve_vec_exact(rust_task* task, rust_vec** vpp, size_t size) {
if (size > (*vpp)->alloc) { if (size > (*vpp)->alloc) {
*vpp = (rust_vec*)task->kernel->realloc(*vpp, size + sizeof(rust_vec)); *vpp = (rust_vec*)task->kernel
->realloc(*vpp, size + sizeof(rust_vec));
(*vpp)->alloc = size; (*vpp)->alloc = size;
} }
} }
@ -107,7 +108,8 @@ inline void reserve_vec(rust_task* task, rust_vec** vpp, size_t size) {
typedef rust_vec rust_str; typedef rust_vec rust_str;
inline rust_str * inline rust_str *
make_str(rust_kernel* kernel, const char* c, size_t strlen, const char* name) { make_str(rust_kernel* kernel, const char* c, size_t strlen,
const char* name) {
size_t str_fill = strlen + 1; size_t str_fill = strlen + 1;
size_t str_alloc = str_fill; size_t str_alloc = str_fill;
rust_str *str = (rust_str *) rust_str *str = (rust_str *)

View File

@ -25,7 +25,8 @@ lock_and_signal::lock_and_signal()
// TODO? Consider checking GetProcAddress("InitializeCriticalSectionEx") // TODO? Consider checking GetProcAddress("InitializeCriticalSectionEx")
// so Windows >= Vista we can use CRITICAL_SECTION_NO_DEBUG_INFO to avoid // so Windows >= Vista we can use CRITICAL_SECTION_NO_DEBUG_INFO to avoid
// allocating CRITICAL_SECTION debug info that is never released. See: // allocating CRITICAL_SECTION debug info that is never released. See:
// http://stackoverflow.com/questions/804848/critical-sections-leaking-memory-on-vista-win2008#889853 // http://stackoverflow.com/questions/804848/
// critical-sections-leaking-memory-on-vista-win2008#889853
} }
#else #else