https://ciechanowski.me/blog/2014/03/05/exposing-nsmutablearray/
Inserting object at index 0 uses the circular buffer magic to put thenewly inserted object at the end of the buffer[…] This is fantasticnews! It means that
__NSArrayM
can be processed from either side. You can use__NSArrayM
as either stack or queue without anyperformance hits.
This is a fascinating deep-dive into how NSMutableArray
works.