dispose method

void dispose()

Disposes the array and frees the allocated memory.

Implementation

void dispose() {
  calloc.free(data);
  data = nullptr;
  length = 0;
  capacity = 0;
}