@@ -35,7 +35,7 @@ pub struct Allocation<Tag=(),Extra=()> {
3535 /// Only the first byte of a pointer is inserted into the map; i.e.,
3636 /// every entry in this map applies to `pointer_size` consecutive bytes starting
3737 /// at the given offset.
38- pub relocations : Relocations < Tag > ,
38+ relocations : Relocations < Tag > ,
3939 /// Denotes which part of this allocation is initialized.
4040 undef_mask : UndefMask ,
4141 /// The size of the allocation. Currently, must always equal `bytes.len()`.
@@ -148,6 +148,11 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
148148 pub fn undef_mask ( & self ) -> & UndefMask {
149149 & self . undef_mask
150150 }
151+
152+ /// Returns the relocation list.
153+ pub fn relocations ( & self ) -> & Relocations < Tag > {
154+ & self . relocations
155+ }
151156}
152157
153158impl < ' tcx > rustc_serialize:: UseSpecializedDecodable for & ' tcx Allocation { }
@@ -459,7 +464,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
459464/// Relocations
460465impl < ' tcx , Tag : Copy , Extra > Allocation < Tag , Extra > {
461466 /// Returns all relocations overlapping with the given ptr-offset pair.
462- pub fn relocations (
467+ pub fn get_relocations (
463468 & self ,
464469 cx : & impl HasDataLayout ,
465470 ptr : Pointer < Tag > ,
@@ -480,7 +485,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
480485 ptr : Pointer < Tag > ,
481486 size : Size ,
482487 ) -> InterpResult < ' tcx > {
483- if self . relocations ( cx, ptr, size) . is_empty ( ) {
488+ if self . get_relocations ( cx, ptr, size) . is_empty ( ) {
484489 Ok ( ( ) )
485490 } else {
486491 throw_unsup ! ( ReadPointerAsBytes )
@@ -502,7 +507,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
502507 // Find the start and end of the given range and its outermost relocations.
503508 let ( first, last) = {
504509 // Find all relocations overlapping the given range.
505- let relocations = self . relocations ( cx, ptr, size) ;
510+ let relocations = self . get_relocations ( cx, ptr, size) ;
506511 if relocations. is_empty ( ) {
507512 return Ok ( ( ) ) ;
508513 }
0 commit comments