-
Notifications
You must be signed in to change notification settings - Fork 287
Remove stash slab allocator from the engine #4394
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
Draft
d-torrance
wants to merge
6
commits into
Macaulay2:development
Choose a base branch
from
d-torrance:remove-stash
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9dfaa66
e: remove dead code referencing system/ directory
d-torrance 79bb770
e: remove stash class; replace with direct GC allocation in GB code
d-torrance 1bf1a46
e: replace stash with direct GC allocation in monomial ideal code
d-torrance fe1570a
e: replace stash with direct GC allocation in resolution code
d-torrance 2e4b854
e: remove remaining stash references from engine, debug, and F4 code
d-torrance e9df862
e: delete mem.hpp/mem.cpp and remove all stale references
d-torrance File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
| #include "basic-rings/aring-glue.hpp" | ||
| #include "coeffrings.hpp" | ||
| #include "free-modules/freemod.hpp" | ||
| #include "mem.hpp" | ||
| #include "rings/ring.hpp" | ||
| #include "free-modules/schreyer-orders.hpp" | ||
| #include "text-io.hpp" | ||
|
|
@@ -18,17 +17,9 @@ | |
| #define sizeofgbvector(s, len) \ | ||
| (sizeof(*s) - sizeof(s->monom) + (len) * sizeof(s->monom[0])) | ||
|
|
||
| void GBRing::memstats() | ||
| { | ||
| buffer o; | ||
| mem->stats(o); | ||
| emit(o.str()); | ||
| } | ||
|
|
||
| gbvector *GBRing::new_raw_term() | ||
| { | ||
| void *p = mem->new_elem(); | ||
| return (reinterpret_cast<gbvector *>(p)); | ||
| return reinterpret_cast<gbvector *>(newarray_clear(char, gbvector_size)); | ||
|
Contributor
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. You could in theory use the |
||
| } | ||
|
|
||
| /************************* | ||
|
|
@@ -43,10 +34,7 @@ exponents_t GBRing::exponents_make() | |
|
|
||
| void GBRing::exponents_delete(exponents_t e) { freemem(e); } | ||
| //////////////////////////////////////////////////////////////// | ||
| GBRing::~GBRing() | ||
| { | ||
| delete mem; // all other things will be garbage collected | ||
| } | ||
| GBRing::~GBRing() {} | ||
| GBRingPoly::~GBRingPoly() {} | ||
| GBRingWeyl::~GBRingWeyl() {} | ||
| GBRingWeylZZ::~GBRingWeylZZ() {} | ||
|
|
@@ -73,7 +61,6 @@ GBRing::GBRing(const Ring *K0, const Monoid *M0) | |
| monom_size = MONOMIAL_BYTE_SIZE(M->monomial_size()); | ||
|
|
||
| gbvector_size = sizeofgbvector(((gbvector *)nullptr), M->monomial_size()); | ||
| mem = new stash("gbvector", gbvector_size); | ||
|
|
||
| const Z_mod *Kp = K->cast_to_Z_mod(); | ||
| if (Kp != nullptr) zzp = Kp->get_CoeffRing(); | ||
|
|
@@ -281,8 +268,7 @@ void GBRing::gbvector_remove_term(gbvector *f) | |
| // It is not clear whether we should try to free elements of K | ||
| f->next = nullptr; | ||
| f->coeff = ZERO_RINGELEM; | ||
| mem->delete_elem(f); | ||
| // GC_FREE(reinterpret_cast<char *>(f)); | ||
| freemem(f); | ||
| } | ||
|
|
||
| void GBRing::gbvector_remove(gbvector *f0) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Arrays of ints should really use
newarray_atomic_clear. theatomicvariants should be used when there are no pointers in the array