represents a managed object.
ManagedObject
represents a managed object.
Details
- ManagedObject is returned by functions such as CreateManagedObject.
- Only active managed objects evaluate the freeing function when they are no longer referenced.
- Managed objects can be inactivated with UnmanageObject.
- Information for a ManagedObject may include the following properties:
-
"Active" True if the object is actively being managed "BaseValue" the base value "FreeingFunction" the freeing function "Value" the value - Properties can be accessed with ManagedObject[…][prop].
- Properties that can be extracted include all Information properties listed above.
- Many functions that expect pointer objects will automatically unwrap managed expressions containing pointers.
Examples
open all close allBasic Examples (2)
Scope (1)
Information (1)
obj = CreateManagedObject[foo, Echo]Get Information about the object:
info = Information[obj]Get the value of the managed object:
info["Value"]Get the freeing function of the object:
info["FreeingFunction"]List the operations available to this object:
info["Operations"]Properties & Relations (3)
man = CreateManagedObject[foo, Echo]To stop managing the object, use UnmanageObject:
UnmanageObject[man]The ManagedObject is no longer active:
man["Active"]Functions like RawMemoryAllocate return a managed RawPointer:
ptr = RawMemoryAllocate["UnsignedInteger8"]The freeing function is RawMemoryFree:
ptr["FreeingFunction"]Export a string as raw memory:
man = RawMemoryExport["A string"]Read the value stored in the pointer:
RawMemoryRead[man["Value"]]Many functions will automatically unwrap managed pointers:
RawMemoryRead[man]Tech Notes
Related Guides
History
Text
Wolfram Research (2023), ManagedObject, Wolfram Language function, https://reference.wolfram.com/language/ref/ManagedObject.html.
CMS
Wolfram Language. 2023. "ManagedObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ManagedObject.html.
APA
Wolfram Language. (2023). ManagedObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ManagedObject.html
BibTeX
@misc{reference.wolfram_2026_managedobject, author="Wolfram Research", title="{ManagedObject}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/ManagedObject.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_managedobject, organization={Wolfram Research}, title={ManagedObject}, year={2023}, url={https://reference.wolfram.com/language/ref/ManagedObject.html}, note=[Accessed: 12-June-2026]}