Malloc() & Arduino

Hello world!
I need to save in a buffer an huge quantity of data. I'm thinking to use malloc() function to do it. My goal is to save them in a dynamic buffer, once it is full save data on a microSD. Is it possible in your opinion?

A small arduino only has 2k of RAM - hardly huge.

Allan.

sorry Allanhurst I don't understand your message, my idea is practicable or not? Beacause my goal is to acquire data in 50 Hz and then save them in a micro SD. Unfortunately is not so simply at these frequencies so that I have tried to create a static buffer, no solution. I have used interrupts and I have "conquered" 25 Hz but I want more. I have thought a dynamic buffer, save data on them and copy them on the Micro SD...what are your suggestions?

What is the size of dynamic buffer you need?
If you need more, then you can use Arduino Due which have 96 KBytes

I know that can sounds strange but it is the key point. I have to detect the angular position of a potentiometer but I don't know for how many values I have to take note, so my buffer dimension is a problem. I have thougth to write value in a buffer and then save it on a micro SD in a dynamic way

Malloc won't help you and indeed is best avoided on devices with so little RAM. The best you can do I think is declare a static buffer (or two) and write to the SD when full.