A macron is a diacritical mark, which, in modern Latin texts, is sometimes used to mark a long vowel: ā, ē, ī, ō, ū, ȳ. From Roman uses of diacritical marks, I understand that the ancient Romans did not use macrons (they occasionally used an apex instead).
So my question is: when were macrons first used to mark Latin text? I'll keep it general, and not limit it to the way macrons are used today, in case they were originally used for some other purpose besides marking vowel length.