about summary refs log tree commit diff
path: root/src/librustc/mir/interpret/allocation.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-886/+0
2020-03-26avoid catching InterpErrorRalf Jung-5/+11
2020-03-25add usize methods for Size gettersRalf Jung-4/+4
2020-03-25go back to infix ops for SizeRalf Jung-12/+12
2020-03-25use Size addition instead of checked int additionRalf Jung-1/+1
2020-03-25make Size::from* methods generic in the integer type they acceptRalf Jung-9/+4
2020-03-25use checked casts and arithmetic in Miri engineRalf Jung-40/+38
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-24/+4
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-1/+1
2020-03-11generalize InvalidNullPointerUsage to InvalidIntPointerUsageRalf Jung-0/+1
2020-03-11miri: categorize errors into "unsupported" and "UB"Ralf Jung-2/+2
Also slightly refactor pointer bounds checks to avoid creating unnecessary temporary Errors
2020-03-06fix various typosMatthias Krüger-1/+1
2020-03-04use integer assoc consts instead of methodsRalf Jung-7/+7
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-1/+1
example: let s: String = format!("hello").into();
2020-02-24don't explicitly compare against true or falseMatthias Krüger-1/+1
2019-12-28Avoid copying some undef memory in MIRSantiago Pastorino-0/+8
During MIR interpretation it may happen that a place containing uninitialized bytes is copied. This would read the current representation of these bytes and write it to the destination even though they must, by definition, not matter to the execution. This elides that representation change when no bytes are defined in such a copy, saving some cpu cycles. In such a case, the memory of the target allocation is not touched at all which also means that sometimes no physical page backing the memory allocation of the representation needs to be provided by the OS at all, reducing memory pressure on the system.
2019-12-22Format the worldMark Rousskov-106/+75
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-2/+2
2. mir::Mutability -> ast::Mutability.
2019-11-19More HashStable.Camille GILLOT-4/+2
2019-10-22relax ExactSizeIterator bound on write_bytes: too many iterators don't have ↵Ralf Jung-2/+5
that bound
2019-10-21remove write_repeat; it is subsumed by the new write_bytesRalf Jung-19/+0
2019-10-21points the user away from the Allocation type and towards the Memory typeRalf Jung-0/+12
2019-10-20also check the iterator is not too longRalf Jung-0/+1
2019-10-20miri add write_bytes method to Memory doing bounds-checks and supporting ↵Ralf Jung-2/+7
iterators
2019-09-17rename Allocation::retag -> with_tags_and_extraRalf Jung-2/+2
2019-09-07Apply suggestions from code reviewAlexander Regueiro-4/+5
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: librustcAlexander Regueiro-55/+54
2019-09-06Fix miriOliver Scherer-0/+28
2019-09-02Auto merge of #63561 - HeroicKatora:alloc-private-bytes, r=oli-obkbors-13/+196
Make Allocation::bytes private Fixes #62931. Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic. cc: @RalfJung
2019-08-31Reorder AllocationDefinedness membersAndreas Molzer-2/+3
This improves the clarity of the documentation a bit since they can reference each other when reading the member docs in sequence.
2019-08-31Improve documentation around allocation accessorsAndreas Molzer-8/+13
2019-08-30Move relocation range copies into allocationAndreas Molzer-0/+50
2019-08-29Make allocation relocation field privateAndreas Molzer-4/+9
2019-08-28Address naming and comments from reviewsAndreas Molzer-4/+4
2019-08-21Expose encapsulated undef mask as immutableAndreas Molzer-0/+5
2019-08-21Replace usage of alloc.bytes in interpretAndreas Molzer-0/+2
There is now a dedicate `len` method which avoids the need to access the bytes. Access the length as `Size` can also be done by a direct member. The constructors guarantee that these representations are convertable. Access which relies on the bytes, such as snapshot, can use direct raw access by reference as it does not care about undef and relocations or properly checks them seperately.
2019-08-17fix typosDante-Broggi-1/+1
2019-08-17Move copy of undef_mask into allocationAndreas Molzer-0/+85
This also means that the compressed representation chosen may be optimized together with any changes to the undef_mask.
2019-08-17Derive HashStable for AllocationAndreas Molzer-1/+12
Requires a manual implementation for Relocations since dereferencing to SortedMap is not always implemented but that one is far more trivial. Added fields could otherwise be silently forgotten since private fields make destructing outside the module possible only with `..` pattern which would then also be applicable to newly added public fields.
2019-08-17Store allocation size, make bytes, undef_mask privateAndreas Molzer-8/+27
Direct access to the bytes was previously a problem (#62931) where components would read their contents without properly checking relocations and/or definedness. Making bytes private instead of purely renaming them also helps in allowing amendments to their allocation scheme (such as eliding allocation for undef of constant regions).
2019-07-31code review fixesSaleem Jaffer-3/+3
2019-07-30renaming throw_err_* to throw_*Saleem Jaffer-3/+3
2019-07-30renaming err to err_unsupSaleem Jaffer-3/+3
2019-07-30adding throw_ and err_ macros for InterpErrorSaleem Jaffer-3/+3
2019-07-29adding a err macro for each of the InterpError variantsSaleem Jaffer-4/+3
2019-07-29fixing fallout due to InterpError refactorSaleem Jaffer-3/+4
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-1/+1
2019-06-24fix reoccurring typoRalf Jung-10/+10
2019-06-23clean up internals of pointer checks; make get_size_and_align also check for ↵Ralf Jung-10/+1
fn allocations