Support for stack promotion in the runtime.

NFC yet.




Swift SVN r32928
This commit is contained in:
Erik Eckstein
2015-10-28 00:43:45 +00:00
parent 79c3eebe4b
commit 4a1dffec32
3 changed files with 39 additions and 1 deletions

View File

@@ -52,7 +52,20 @@ struct OpaqueValue;
extern "C" HeapObject *swift_allocObject(HeapMetadata const *metadata,
size_t requiredSize,
size_t requiredAlignmentMask);
/// Initializes the object header of a stack allocated object.
///
/// \param metadata - the object's metadata which is stored in the header
/// \param object - the pointer to the object's memory on the stack
/// \returns the passed object pointer.
extern "C" HeapObject *swift_initStackObject(HeapMetadata const *metadata,
HeapObject *object);
/// Performs verification that the lifetime of a stack allocated object has
/// ended. It asserts if the reference counts of the object indicate that the
/// object did escape to some other location.
extern "C" void swift_verifyEndOfLifetime(HeapObject *object);
/// The structure returned by swift_allocPOD and swift_allocBox.
struct BoxPair {
/// The pointer to the heap object.