title: C and C++: Freeing PART of an allocated pointer
body: <p>Let's say I have a pointer allocated to hold 4096 bytes.  How would one deallocate the last 1024 bytes in C?  What about in C++?  What if, instead, I wanted to deallocate the <em>first</em> 1024 bytes, and keep the rest (in both languages)?  What about deallocating from the middle (it seems to me that this would require splitting it into two pointers, before and after the deallocated region).</p>