MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _anon_varea_shrink

Function _anon_varea_shrink

components/mm/mm_anon.c:196–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196static rt_err_t _anon_varea_shrink(rt_varea_t varea, void *new_start, rt_size_t size)
197{
198 char *varea_start = varea->start;
199 void *rm_start;
200 void *rm_end;
201
202 if (varea_start == (char *)new_start)
203 {
204 rm_start = varea_start + size;
205 rm_end = varea_start + varea->size;
206 }
207 else /* if (varea_start < (char *)new_start) */
208 {
209 RT_ASSERT(varea_start < (char *)new_start);
210 rm_start = varea_start;
211 rm_end = new_start;
212 }
213
214 _pgmgr_pop_range(varea, rm_start, rm_end);
215 return RT_EOK;
216}
217
218static rt_err_t _anon_varea_split(struct rt_varea *existed, void *unmap_start, rt_size_t unmap_len, struct rt_varea *subset)
219{

Callers

nothing calls this directly

Calls 1

_pgmgr_pop_rangeFunction · 0.85

Tested by

no test coverage detected