ScummVM API documentation
Sci::SegmentObj Struct Referenceabstract
Inheritance diagram for Sci::SegmentObj:
Common::Serializable Sci::DataStack Sci::DynMem Sci::LocalVariables Sci::Script Sci::SegmentObjTable< T > Sci::SegmentObjTable< Clone > Sci::SegmentObjTable< Hunk > Sci::SegmentObjTable< List > Sci::SegmentObjTable< Node >

Public Member Functions

 SegmentObj (SegmentType type)
 
SegmentType getType () const
 
virtual bool isValidOffset (uint32 offset) const =0
 
virtual SegmentRef dereference (reg_t pointer)
 
virtual reg_t findCanonicAddress (SegManager *segMan, reg_t sub_addr) const
 
virtual void freeAtAddress (SegManager *segMan, reg_t sub_addr)
 
virtual Common::Array< reg_tlistAllDeallocatable (SegmentId segId) const
 
virtual Common::Array< reg_tlistAllOutgoingReferences (reg_t object) const
 
- Public Member Functions inherited from Common::Serializable
virtual void saveLoadWithSerializer (Serializer &ser)=0
 

Static Public Member Functions

static SegmentObjcreateSegmentObj (SegmentType type)
 

Public Attributes

SegmentType _type
 

Member Function Documentation

◆ isValidOffset()

virtual bool Sci::SegmentObj::isValidOffset ( uint32  offset) const
pure virtual

Check whether the given offset into this memory object is valid, i.e., suitable for passing to dereference.

Implemented in Sci::DynMem, Sci::SegmentObjTable< T >, Sci::SegmentObjTable< Node >, Sci::SegmentObjTable< Clone >, Sci::SegmentObjTable< Hunk >, Sci::SegmentObjTable< List >, Sci::DataStack, Sci::LocalVariables, and Sci::Script.

◆ dereference()

virtual SegmentRef Sci::SegmentObj::dereference ( reg_t  pointer)
virtual

Dereferences a raw memory pointer.

Parameters
regreference to dereference
Returns
the data block referenced

Reimplemented in Sci::DynMem, Sci::DataStack, Sci::LocalVariables, and Sci::Script.

◆ findCanonicAddress()

virtual reg_t Sci::SegmentObj::findCanonicAddress ( SegManager segMan,
reg_t  sub_addr 
) const
inlinevirtual

Finds the canonic address associated with sub_reg. Used by the garbage collector.

For each valid address a, there exists a canonic address c(a) such that c(a) = c(c(a)). This address "governs" a in the sense that deallocating c(a) will deallocate a.

Parameters
sub_addrbase address whose canonic address is to be found

Reimplemented in Sci::DynMem, Sci::DataStack, Sci::LocalVariables, and Sci::Script.

◆ freeAtAddress()

virtual void Sci::SegmentObj::freeAtAddress ( SegManager segMan,
reg_t  sub_addr 
)
inlinevirtual

Deallocates all memory associated with the specified address. Used by the garbage collector.

Parameters
sub_addraddress (within the given segment) to deallocate

Reimplemented in Sci::HunkTable, Sci::ListTable, Sci::NodeTable, Sci::CloneTable, and Sci::Script.

◆ listAllDeallocatable()

virtual Common::Array<reg_t> Sci::SegmentObj::listAllDeallocatable ( SegmentId  segId) const
inlinevirtual

Iterates over and reports all addresses within the segment. Used by the garbage collector.

Returns
a list of addresses within the segment

Reimplemented in Sci::DynMem, Sci::SegmentObjTable< T >, Sci::SegmentObjTable< Node >, Sci::SegmentObjTable< Clone >, Sci::SegmentObjTable< Hunk >, Sci::SegmentObjTable< List >, and Sci::Script.

◆ listAllOutgoingReferences()

virtual Common::Array<reg_t> Sci::SegmentObj::listAllOutgoingReferences ( reg_t  object) const
inlinevirtual

Iterates over all references reachable from the specified object. Used by the garbage collector.

Parameters
objectobject (within the current segment) to analyze
Returns
a list of outgoing references within the object
Note
This function may also choose to report numbers (segment 0) as adresses

Reimplemented in Sci::ListTable, Sci::NodeTable, Sci::CloneTable, Sci::DataStack, Sci::LocalVariables, and Sci::Script.


The documentation for this struct was generated from the following file: