Ok, i will give you a little more insight into what i actually need..if i allocate some memory using malloc() i free it using free() ,now free gets the info regarding the amount of memory to be freed from the data stored just before the start of the pointer returned by malloc..

Like dlmalloc used in Linux we have [Prev_size][Size][Data] representing the chunk structure of the memory with the various information, the block [Size] actually holds the Size allocated for the current chunk...I was wondering if i can actually use the size data to get the size of the block allocated...Here is my problem,i am not able to do it..not getting the correct output.