Hi,
Question about malloc and free. Suppose I malloc a buffer of size, say 100 bytes, but end up only needing 90 of those bytes. Is there a way at all to free the remaining 10 bytes?
Should I just have a pointer point to the 91st byte and then free it? How would the compiler know where the 2nd pointer ends (i.e., how much to free?) I'm guessing the kernel must maintain some understanding of this as it already manages the virtual to physical memory mappings.
Thanks.