element-serial
main
In the last revision, the next element serial number was thread-safe, but that might be overdoing it. I suspect that elements will only ever be created from the main thread.
For future thread-safety, keep the next serial number in a static atomic variable.