Lines Matching refs:vm
40 static Block_t* _vmextend(reg Vmalloc_t* vm, size_t size, Vmsearch_f searchf )
42 static Block_t* _vmextend(vm, size, searchf )
43 reg Vmalloc_t* vm; /* region to increase in size */
52 reg Vmdata_t* vd = vm->data;
67 if(size > 2*vd->incr && vm->disc->round < vd->incr)
73 { addr = (Vmuchar_t*)(*vm->disc->memoryf)(vm,seg->addr,seg->extent,
74 seg->extent+size,vm->disc);
81 { if(!(addr = (Vmuchar_t*)(*vm->disc->memoryf)(vm, NIL(Void_t*), 0, size, vm->disc)) )
82 { if(vm->disc->exceptf) /* announce that no more memory is available */
84 CLRLOCK(vm, 0);
85 (void)(*vm->disc->exceptf)(vm, VM_NOMEM, (Void_t*)size, vm->disc);
86 SETLOCK(vm, 0);
186 static ssize_t _vmtruncate(Vmalloc_t* vm, Seg_t* seg, size_t size, int exact)
188 static ssize_t _vmtruncate(vm, seg, size, exact)
189 Vmalloc_t* vm; /* containing region */
197 reg Vmdata_t* vd = vm->data;
198 reg Vmemory_f memoryf = vm->disc->memoryf;
208 { if((less = vm->disc->round) <= 0)
217 (*memoryf)(vm,caddr,seg->extent,seg->extent-less,vm->disc) != caddr)
241 if((*memoryf)(vm,caddr,seg->extent,0,vm->disc) == caddr)
257 int _vmlock(Vmalloc_t* vm, int locking)
259 if(!vm) /* some sort of global locking */
264 else if(vm->data->mode&VM_SHARE)
266 asolock(&vm->data->lock, 1, ASO_UNLOCK);
267 else asolock(&vm->data->lock, 1, ASO_SPINLOCK);
271 vm->data->lock = 0;
272 else vm->data->lock = 1;