| 112 | |
| 113 | |
| 114 | void SimpleHeap::Delete(void *aPtr) |
| 115 | // If aPtr is the most recently allocated area of memory by SimpleHeap, this will reclaim that |
| 116 | // memory. Otherwise, the caller should realize that the memory cannot be reclaimed (i.e. potential |
| 117 | // memory leak unless caller handles things right). |
| 118 | { |
| 119 | if (aPtr != sMostRecentlyAllocated || !sMostRecentlyAllocated) |
| 120 | return; |
| 121 | size_t sMostRecentlyAllocated_size = sLast->mFreeMarker - sMostRecentlyAllocated; |
| 122 | sLast->mFreeMarker -= sMostRecentlyAllocated_size; |
| 123 | sLast->mSpaceAvailable += sMostRecentlyAllocated_size; |
| 124 | sMostRecentlyAllocated = NULL; // i.e. no support for anything other than a one-time delete of an item just added. |
| 125 | } |
| 126 | |
| 127 | |
| 128 |
nothing calls this directly
no outgoing calls
no test coverage detected