Lines Matching refs:size
39 static Block_t* vmextend(reg Vmalloc_t* vm, size_t size, Vmsearch_f searchf )
41 static Block_t* vmextend(vm, size, searchf )
42 reg Vmalloc_t* vm; /* region to increase in size */
43 size_t size; /* desired amount of space */
66 s = size + sizeof(Seg_t) + sizeof(Block_t) + sizeof(Head_t) + 2*ALIGN;
67 if(s <= size) /* size was too large and we have wrapped around */
69 if((size = ROUND(s,vd->incr)) < s)
73 if(size > 2*vd->incr && vm->disc->round < vd->incr)
84 if((s = (s/vd->incr)*vd->incr) == size)
85 size += vd->incr;
88 seg->extent+size-s,vm->disc);
94 size -= s;
99 { if((addr = (Vmuchar_t*)(*memoryf)(vm,NIL(Void_t*),0,size,vm->disc)) )
109 rv = (*exceptf)(vm,VM_NOMEM,(Void_t*)size,vm->disc);
127 SIZE(bp) = size - sizeof(Head_t);
134 SIZE(bp) += size;
141 SIZE(bp) += size;
145 SIZE(bp) = size - sizeof(Head_t);
149 seg->size += size;
150 seg->extent += size;
151 seg->baddr += size;
163 seg->extent = size;
164 seg->baddr = addr + size - (s ? 2*ALIGN : 0);
185 seg->size = SIZE(bp);
211 static ssize_t vmtruncate(Vmalloc_t* vm, Seg_t* seg, size_t size, int exact)
213 static ssize_t vmtruncate(vm, seg, size, exact)
216 size_t size; /* amount of free space */
227 if(size < seg->size)
231 less = size;
235 less = (size/less)*less;
237 if(less > 0 && size > (size_t)less && (size-(size_t)less) < sizeof(Block_t) )
246 seg->size -= less;
267 return size;