diff options
| author | Jesse Jones <jesse9jones@gmail.com> | 2012-12-08 22:06:46 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-12-15 22:38:20 -0800 |
| commit | e8d2d559002d6f1cb0a12553674b9b0383224512 (patch) | |
| tree | 167900135b334e381f012df64969c7aa7bd39f70 | |
| parent | eca23da98b7b0a9998ef2307a2ae63f30b1f955d (diff) | |
| download | rust-e8d2d559002d6f1cb0a12553674b9b0383224512.tar.gz rust-e8d2d559002d6f1cb0a12553674b9b0383224512.zip | |
Made a bunch more classes non-copyable
| -rw-r--r-- | src/rt/boxed_region.h | 5 | ||||
| -rw-r--r-- | src/rt/circular_buffer.h | 5 | ||||
| -rw-r--r-- | src/rt/memory_region.h | 5 | ||||
| -rw-r--r-- | src/rt/rust_sched_launcher.h | 5 | ||||
| -rw-r--r-- | src/rt/rust_sched_loop.h | 5 | ||||
| -rw-r--r-- | src/rt/rust_scheduler.h | 5 | ||||
| -rw-r--r-- | src/rt/rust_signal.h | 6 | ||||
| -rw-r--r-- | src/rt/rust_task.h | 5 |
8 files changed, 41 insertions, 0 deletions
diff --git a/src/rt/boxed_region.h b/src/rt/boxed_region.h index 8e7203b723a..5578a7198b0 100644 --- a/src/rt/boxed_region.h +++ b/src/rt/boxed_region.h @@ -35,6 +35,11 @@ private: return v; } +private: + // private and undefined to disable copying + boxed_region(const boxed_region& rhs); + boxed_region& operator=(const boxed_region& rhs); + public: boxed_region(rust_env *e, memory_region *br) : env(e) diff --git a/src/rt/circular_buffer.h b/src/rt/circular_buffer.h index 10eef04f803..f632ff73ee6 100644 --- a/src/rt/circular_buffer.h +++ b/src/rt/circular_buffer.h @@ -36,6 +36,11 @@ public: size_t size(); private: + // private and undefined to disable copying + circular_buffer(const circular_buffer& rhs); + circular_buffer& operator=(const circular_buffer& rhs); + +private: size_t initial_size(); void grow(); void shrink(); diff --git a/src/rt/memory_region.h b/src/rt/memory_region.h index eaaa8bac623..39b8cf1643e 100644 --- a/src/rt/memory_region.h +++ b/src/rt/memory_region.h @@ -69,6 +69,11 @@ private: void release_alloc(void *mem); void claim_alloc(void *mem); +private: + // private and undefined to disable copying + memory_region(const memory_region& rhs); + memory_region& operator=(const memory_region& rhs); + public: memory_region(rust_env *env, bool synchronized); memory_region(memory_region *parent); diff --git a/src/rt/rust_sched_launcher.h b/src/rt/rust_sched_launcher.h index 44022967ebc..9073e70b3f1 100644 --- a/src/rt/rust_sched_launcher.h +++ b/src/rt/rust_sched_launcher.h @@ -23,6 +23,11 @@ public: private: rust_sched_loop sched_loop; +private: + // private and undefined to disable copying + rust_sched_launcher(const rust_sched_launcher& rhs); + rust_sched_launcher& operator=(const rust_sched_launcher& rhs); + protected: rust_sched_driver driver; diff --git a/src/rt/rust_sched_loop.h b/src/rt/rust_sched_loop.h index dcbafe82560..d1cfa2090a2 100644 --- a/src/rt/rust_sched_loop.h +++ b/src/rt/rust_sched_loop.h @@ -82,6 +82,11 @@ private: void pump_loop(); +private: + // private and undefined to disable copying + rust_sched_loop(const rust_sched_loop& rhs); + rust_sched_loop& operator=(const rust_sched_loop& rhs); + public: rust_kernel *kernel; rust_scheduler *sched; diff --git a/src/rt/rust_scheduler.h b/src/rt/rust_scheduler.h index c0e8c95d0fd..4a6c4ccccd3 100644 --- a/src/rt/rust_scheduler.h +++ b/src/rt/rust_scheduler.h @@ -58,6 +58,11 @@ private: // Called when refcount reaches zero void delete_this(); +private: + // private and undefined to disable copying + rust_scheduler(const rust_scheduler& rhs); + rust_scheduler& operator=(const rust_scheduler& rhs); + public: rust_scheduler(rust_kernel *kernel, size_t max_num_threads, rust_sched_id id, bool allow_exit, bool killed, diff --git a/src/rt/rust_signal.h b/src/rt/rust_signal.h index 0f6ecb94303..bfea68a1aad 100644 --- a/src/rt/rust_signal.h +++ b/src/rt/rust_signal.h @@ -16,6 +16,12 @@ class rust_signal { public: virtual void signal() = 0; virtual ~rust_signal() {} + rust_signal() {} + +private: + // private and undefined to disable copying + rust_signal(const rust_signal& rhs); + rust_signal& operator=(const rust_signal& rhs); }; #endif /* RUST_SIGNAL_H */ diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index e54c9dbf140..5b3c0568edc 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -305,6 +305,11 @@ private: void wakeup_inner(rust_cond *from); bool blocked_on(rust_cond *cond); +private: + // private and undefined to disable copying + rust_task(const rust_task& rhs); + rust_task& operator=(const rust_task& rhs); + public: // Only a pointer to 'name' is kept, so it must live as long as this task. |
