How to code a circular buffer in an external.

Hey everybody, thanks for the help with my float inlet yesterday!
I am now trying to add a circular buffer to my external. The buffer will need to hold something in the order of 2048 samples.
Now Im thinking I need to create this buffer outside the perform routine as this routine only works in chunks of samples as per the Signal Vector size, right? So where do I create the array to store these samples, in the structure defn or in the new instance routine, or where?
As far as I understand it the array/buffer will need to outside the perform routine so it can store samples from previous Signal Vectors. So i guess this needs to be a global variable that can be accessed from the perform routine, but i guess Im not sure where is the best place to do this code in an MSP external.
Your help is greatly appreciated,
cheers,
enda