I mean if your world is 1024 by 768, and a boid is affected by all other boids within 64 pixels of it, you should just break the world up into 16 by 12 bins, each representing a 64 by 64 pixel block. Each of these blocks is just a growable array.
All of a boid's "close enough" neighbours will be found in the 8-neighbourhood of its block.