Lines Matching refs:seg

44 	reg Seg_t	*seg, *last;  local
63 { for(last = NIL(Seg_t*), seg = vd->seg; seg; last = seg, seg = seg->next)
64 { if(!(tp = seg->free) || (SIZE(tp)+sizeof(Head_t)) < size)
67 { last->next = seg->next;
68 seg->next = vd->seg;
69 vd->seg = seg;
76 { seg = SEG(tp);
88 SEG(next) = seg;
89 seg->free = next;
91 else seg->free = NIL(Block_t*);
93 vd->free = seg->last = tp;
113 reg Seg_t* seg; local
139 seg = vd->seg;
141 { if(seg->free )
142 s = (Vmuchar_t*)(seg->free) - (Vmuchar_t*)data;
143 else s = (Vmuchar_t*)BLOCK(seg->baddr) - (Vmuchar_t*)data;
149 SEG(fp) = seg;
150 SIZE(fp) = ((Vmuchar_t*)BLOCK(seg->baddr) - (Vmuchar_t*)data) - sizeof(Head_t);
151 seg->free = fp;
152 seg->last = NIL(Block_t*);
172 reg Seg_t *seg; local
205 seg = vd->seg;
208 for(seg = vd->seg; seg; seg = seg->next)
209 if(data >= seg->addr && data < (Void_t*)seg->baddr)
211 if(!seg || (VLONG(data)%ALIGN) != 0 ||
212 (seg->last && (Vmuchar_t*)data > (Vmuchar_t*)seg->last) )
220 if(data != seg->last)
221 { if(seg->last && (Vmuchar_t*)data < (Vmuchar_t*)seg->last)
222 oldsize = (Vmuchar_t*)seg->last - (Vmuchar_t*)data;
223 else oldsize = (Vmuchar_t*)BLOCK(seg->baddr) - (Vmuchar_t*)data;
227 { s = (Vmuchar_t*)BLOCK(seg->baddr) - (Vmuchar_t*)data;
228 if(!(tp = seg->free) )
232 seg->free = NIL(Block_t*);
240 addr = (*vm->disc->memoryf)(vm, seg->addr, seg->extent,
241 seg->extent+ds, vm->disc);
242 if(addr == seg->addr)
244 seg->size += ds;
245 seg->extent += ds;
246 seg->baddr += ds;
247 SIZE(BLOCK(seg->baddr)) = BUSY;
267 if(s >= 0 && seg != vd->seg)
269 SEG(tp) = seg;
271 seg->free = tp;
276 seg = vd->seg;
277 s = (Vmuchar_t*)BLOCK(seg->baddr) -
279 seg->free = NIL(Block_t*);
288 SEG(tp) = seg;
290 seg->free = tp;
293 vd->free = seg->last = (Block_t*)data;
322 if(!vd->free || addr < (Void_t*)vd->free || addr >= (Void_t*)vd->seg->baddr)
341 else if(vd->seg->free)
342 return (Vmuchar_t*)vd->seg->free - (Vmuchar_t*)addr;
343 else return (Vmuchar_t*)vd->seg->baddr - (Vmuchar_t*)addr - sizeof(Head_t);
354 reg Seg_t *seg, *next; local
368 for(seg = vd->seg; seg; seg = next)
369 { next = seg->next;
371 if(!(fp = seg->free))
374 seg->free = NIL(Block_t*);
375 if(seg->size == (s = SIZE(fp)&~BITS))
376 s = seg->extent;
379 if((*_Vmtruncate)(vm,seg,s,1) == s)
380 seg->free = fp;
401 reg Seg_t* seg; local
430 for(seg = vd->seg; seg; seg = seg->next)
431 if(seg->last == (Block_t*)data)
433 /**/ASSERT(seg);
441 if((s = (seg->baddr - (Vmuchar_t*)next)) >= sizeof(Block_t))
442 { SEG(next) = seg;
444 seg->free = next;
447 vd->free = seg->last = (Block_t*)data;