uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026

Warning

uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.

MemoryIndex = [int]

Property

Product: 

Class: 

Returns a stable, predictable index for the object, useful for diagnostics and tracking object lifecycles.

Remarks

The MemoryIndex method returns a stable, predictable integer that uniquely identifies an object within its class for the duration of its lifetime. It is primarily a tool for advanced debugging, diagnostics, and tracking object lifecycles.

Key Characteristics

  • Predictable: Unlike a memory address, the MemoryIndex is assigned sequentially. The first Item created will have index 1, the second will have index 2, and so on.
  • Stable: The index of an object will not change during its lifetime.
  • Recycled: When an object is released (e.g., via .Release()), its MemoryIndex is returned to a pool and will be reused by the next object of the same type that is created. This is a key behavior to understand when debugging.

MemoryIndex vs. Handle

It is crucial to distinguish MemoryIndex from an object's Handle.

FeatureMemoryIndexHandle
StabilityStable & Predictable. Sequential integers.Volatile. A memory address that changes between runs.
UniquenessUnique for its lifetime, but recycled after release.Guaranteed unique for the object's lifetime. Never recycled.
PurposeHigh-level diagnostics, logging, lifecycle tracking.Low-level object identification for the C++ core.
Use Case"Is this the same object slot I saw before?""What is the exact memory reference for this object?"

💡 Why uCalc? (Comparative Analysis)

  • vs. C# GetHashCode(): While GetHashCode() provides an integer, it is not guaranteed to be unique, nor is it stable between application runs. MemoryIndex is deterministic and predictable within a single run.
  • vs. C++ Pointers: A raw pointer address in C++ is volatile, similar to uCalc's Handle. MemoryIndex provides a higher-level, more stable identifier that is independent of memory layout.

The MemoryIndex gives developers a reliable tool for introspection that bridges the gap between low-level memory addresses and high-level object references.

Examples