Animation loops not storing the image table?

Hello,

I’m not sure if this is the proper place because I’m not certain myself if I understand correctly the expected behavior. So please bear with me. This is mainly me trying to educate myself.

It’s about animation loops. I spawn random animated waves in the ocean in Atlantic ‘41. Several waves sprites share the same image table, but they’re not animated in sync, since they’re not spawned simultaneously.
So in order to keep track of each sprite current frame, I have a dedicated animation loop for each wave. However all animation loops share the same image table. I hope this makes sense up to here.

Now checking the memory, I noticed that each animation loop stores the entire image table, so basically if I have 5 waves using the same image table, I store 5 times the same image table in memory, each in its own animation loop. Now I’m confused as to why the animation loop, which is essentially a pointer to an image table, stores a duplicate of the entire image table itself.
Wouldn’t it be better if all animation loops pointed to the same image table, so that it would be stored only once in memory? It would essentially be like having instances of the same sprite.

I did a workaround experiment where I give a nil value to the animation loop instead of an image table, and then instead of copying the current animation loop frame to the sprite, I fist get the animation loop frame number, which I then use to get the corresponding image in the image table, and then copy that image in the sprite. It works, and my animation loops are now much lighter, since I only store the image table once in memory, but it’s more convoluted code.

Am I right in expecting animation loops not to store a duplicate of their image table, or am I using the animation loops all wrong because I don’t understand how they work?

Take a look at Animated sprite lib, I hope it'll save you from a pain of guiding animations~