aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_srv.h
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-17 23:40:07 -0700
committerMichael Bebenita <[email protected]>2010-08-17 23:49:57 -0700
commit2c1ec6771bd09266308686ab13ca32e2aa73da49 (patch)
treeacbcae9da89c0f6d37fccdf8b4091f003e798683 /src/rt/rust_srv.h
parentAdd a "special" rust_log flag to be used for debugging in cases where the ful... (diff)
downloadrust-2c1ec6771bd09266308686ab13ca32e2aa73da49.tar.xz
rust-2c1ec6771bd09266308686ab13ca32e2aa73da49.zip
Lots of changes around memory managment in the Runtime. Added memory regions and fixed race caused by calling rust_srv::malloc() from multiple threads when sending messages.
Diffstat (limited to 'src/rt/rust_srv.h')
-rw-r--r--src/rt/rust_srv.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rt/rust_srv.h b/src/rt/rust_srv.h
index b25e5e75..e617c002 100644
--- a/src/rt/rust_srv.h
+++ b/src/rt/rust_srv.h
@@ -5,11 +5,13 @@
#ifndef RUST_SRV_H
#define RUST_SRV_H
+#include "sync/spin_lock.h"
+#include "memory_region.h"
+
class rust_srv {
-private:
- size_t _live_allocations;
- array_list<void *> _allocation_list;
public:
+ memory_region local_region;
+ memory_region synchronized_region;
virtual void log(char const *msg);
virtual void fatal(char const *expression,
char const *file,
@@ -21,12 +23,12 @@ public:
size_t line,
char const *format,
...);
+ virtual void free(void *);
virtual void *malloc(size_t);
virtual void *realloc(void *, size_t);
- virtual void free(void *);
- virtual rust_srv *clone();
rust_srv();
virtual ~rust_srv();
+ virtual rust_srv *clone();
};
#endif /* RUST_SRV_H */