-
Notifications
You must be signed in to change notification settings - Fork 1
Removed dumb smart pointers #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ void octopOS::sig_handler(int sig) { | |
| } | ||
| } | ||
| for (unsigned i = 0; i < NUMMODULES; ++i) { | ||
| tentacles.pop_back(); | ||
| delete tentacles[i]; | ||
| if (msgctl(tentacle_ids[i], IPC_RMID, NULL) < 0) { | ||
| if (sig < 0) | ||
| throw std::system_error( | ||
|
|
@@ -87,8 +87,7 @@ octopOS::octopOS() { | |
| std::generic_category(), | ||
| "Unable to create message queues"); | ||
| } else { | ||
| tentacles.push_back(std::make_shared<tentacle>( | ||
| tentacle(MSGKEY + i))); | ||
| tentacles.push_back(new tentacle(MSGKEY + i)); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -131,7 +130,7 @@ std::pair<unsigned, key_t> octopOS::create_new_topic | |
| } | ||
|
|
||
| void* octopOS::listen_for_child(void* tentacle_id) { | ||
| std::shared_ptr<tentacle> t = tentacles[*(int*)tentacle_id]; // NOLINT | ||
| tentacle* t = tentacles[*(int*)tentacle_id]; // NOLINT | ||
|
|
||
| std::pair<long, std::string> data; // NOLINT | ||
| for (;;) { | ||
|
|
@@ -299,7 +298,7 @@ octopOS::~octopOS() { | |
|
|
||
| int octopOS::shmid = 0; | ||
| int octopOS::tentacle_ids[NUMMODULES]; | ||
| std::vector<std::shared_ptr<tentacle>> octopOS::tentacles; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsafe :(
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole branch is way behind master I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rewrite it in rust
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +2 |
||
| std::vector<tentacle*> octopOS::tentacles; | ||
| std::vector<int> octopOS::semids; | ||
| intptr_t *octopOS::shared_ptr, *octopOS::shared_end_ptr; | ||
| std::unordered_map<std::string, std::tuple<unsigned, key_t, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I like smart pointers. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget why we wanted to remove them. Probably had to do with shm