ya.. I know that..
its because of the page size thats allocated by the OS..
everytime when the process requests for memory it will allocated in multiples of page sizes..
so even though we make malloc call for 100bytes and we access something like 101byte dosent give segfault..
I believe malloc (or any DMA calls) only keeps record of the mem it is left to allocate (i.e pagesize - allocated) the next time if there is any malloc call..
so that it can make out if it has to request system for more pages or if the current page allocated by OS is siffucient
well.. I think if I wanted some thing like runtime_sizeof() then I have to handle all the array elements additions and deletions from the templates in the background..