/ast/src/lib/libast/vmalloc/ |
H A D | vmgetmem.c | 25 * vm open/close/resize - a handy default for discipline memory functions 37 Void_t* vmgetmem(Vmalloc_t* vm, Void_t* data, size_t size) argument 39 Void_t* vmgetmem(vm, data, size) 40 Vmalloc_t* vm; 45 if (!vm) 48 return vmresize(vm, data, size, VM_RSMOVE|VM_RSCOPY|VM_RSZERO); 49 vmclose(vm);
|
H A D | vmdisc.c | 37 Vmdisc_t* vmdisc(Vmalloc_t* vm, Vmdisc_t* disc) argument 39 Vmdisc_t* vmdisc(vm, disc) 40 Vmalloc_t* vm; 44 Vmdisc_t* old = vm->disc; 48 (*old->exceptf)(vm,VM_DISC,(Void_t*)disc,old) != 0 ) 50 vm->disc = disc;
|
H A D | vmregion.c | 44 Vmalloc_t *vm; local 53 for(vm = Vmheap; vm; vm = vm->next) 54 if(vm->data == vd) 58 return vm;
|
H A D | vmwalk.c | 36 int vmwalk(Vmalloc_t* vm, int(*segf)(Vmalloc_t*, Void_t*, size_t, Vmdisc_t*, Void_t*), Void_t* handle ) argument 38 int vmwalk(vm, segf, handle) 39 Vmalloc_t* vm; 47 if(!vm) 49 for(vm = Vmheap; vm; vm = vm->next) 50 { SETLOCK(vm, 0); 51 for(seg = vm [all...] |
H A D | vmsegment.c | 36 Void_t* vmsegment(Vmalloc_t* vm, Void_t* addr) argument 38 Void_t* vmsegment(vm, addr) 39 Vmalloc_t* vm; /* region */ 44 Vmdata_t *vd = vm->data; 46 SETLOCK(vm, 0); 53 CLRLOCK(vm, 0);
|
H A D | vmset.c | 36 int vmset(reg Vmalloc_t* vm, int flags, int on) argument 38 int vmset(vm, flags, on) 39 reg Vmalloc_t* vm; /* region being worked on */ 45 Vmdata_t *vd = vm->data; 50 SETLOCK(vm, 0); 57 CLRLOCK(vm, 0);
|
H A D | vmclear.c | 35 int vmclear(Vmalloc_t* vm) argument 37 int vmclear(vm) 38 Vmalloc_t* vm; 44 Vmdata_t *vd = vm->data; 46 SETLOCK(vm, 0); 80 CLRLOCK(vm, 0);
|
H A D | vmdcheap.c | 35 static Void_t* heapmem(Vmalloc_t* vm, Void_t* caddr, argument 39 static Void_t* heapmem(vm, caddr, csize, nsize, disc) 40 Vmalloc_t* vm; /* region doing allocation from */
|
H A D | vmstat.c | 36 int vmstat(Vmalloc_t* vm, Vmstat_t* st) argument 38 int vmstat(vm, st) 39 Vmalloc_t* vm; 50 return (vm ? vm : Vmregion)->data->lock; 54 if(!vm) 64 SETLOCK(vm, 0); 71 vd = vm->data; 139 CLRLOCK(vm, 0);
|
H A D | vmclose.c | 35 int vmclose(Vmalloc_t* vm) argument 37 int vmclose(vm) 38 Vmalloc_t* vm; 43 Vmdata_t* vd = vm->data; 44 Vmdisc_t* disc = vm->disc; 47 if(vm == Vmheap) /* the heap is never freed */ 50 if(vm->disc->exceptf && /* announcing closing event */ 51 (rv = (*vm->disc->exceptf)(vm,VM_CLOSE,(Void_t*)1,vm [all...] |
H A D | vmopen.c | 45 { Vmalloc_t vm; /* embedded region if needed */ member in union:_vminit_s::__anon321 47 } vm; member in struct:_vminit_s 64 Vmalloc_t *vm, *vmp, vmproto; local 91 { if(addr) /* vm itself is in memory from disc->memoryf */ 160 vm = &init->vm.vm; 161 else if(!(vm = vmalloc(Vmheap, sizeof(Vmalloc_t))) ) 166 memcpy(vm, vmp, sizeof(Vmalloc_t)); 167 vm [all...] |
H A D | vmpool.c | 42 static Void_t* poolalloc(Vmalloc_t* vm, reg size_t size, int local) argument 44 static Void_t* poolalloc(vm, size, local ) 45 Vmalloc_t* vm; 53 reg Vmdata_t *vd = vm->data; 64 SETLOCK(vm, local); 80 if((tp = (*_Vmextend)(vm,ROUND(size,vd->incr),NIL(Vmsearch_f))) ) 106 (*_Vmtrace)(vm,NIL(Vmuchar_t*),(Vmuchar_t*)tp,vd->pool,0); 108 CLRLOCK(vm, local); 114 static long pooladdr(Vmalloc_t* vm, reg Void_t* addr, int local) argument 116 static long pooladdr(vm, add 159 poolfree(reg Vmalloc_t* vm, reg Void_t* data, int local ) argument 192 poolresize(Vmalloc_t* vm, Void_t* data, size_t size, int type, int local ) argument 232 poolsize(Vmalloc_t* vm, Void_t* addr, int local) argument 244 poolcompact(Vmalloc_t* vm, int local) argument 282 poolalign(Vmalloc_t* vm, size_t size, size_t align, int local) argument [all...] |
H A D | vmprivate.c | 40 static Block_t* _vmextend(reg Vmalloc_t* vm, size_t size, Vmsearch_f searchf ) argument 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, NI 186 _vmtruncate(Vmalloc_t* vm, Seg_t* seg, size_t size, int exact) argument 257 _vmlock(Vmalloc_t* vm, int locking) argument [all...] |
/ast/src/cmd/tests/vmalloc/ |
H A D | tek.c | 32 Vmalloc_t *vm; local 33 vm = vmopen (Vmdcsbrk, Vmlast, 0); 57 vms[22] = vmalloc (vm, 29850757); 58 vms[23] = vmalloc (vm, 72); 59 vms[24] = vmalloc (vm, 12); 60 vms[25] = vmalloc (vm, 72); 61 vms[26] = vmalloc (vm, 16); 62 vms[27] = vmalloc (vm, 4); 63 vms[28] = vmalloc (vm, 72); 64 vms[29] = vmalloc (vm, 1 [all...] |
H A D | tlast.c | 25 Vmalloc_t* vm; local 29 if(!(vm = vmopen(Vmdcheap,Vmlast,0)) ) 33 { addr[i] = vmalloc(vm,8); 38 if(vmfree(vm,addr[0]) >= 0) 41 if(vmresize(vm,addr[9],256,1) == NIL(Void_t*)) 46 printf("size[%d]=%d\n",i,vmsize(vm,addr[i])); 47 printf("vmextent=%d\n",vmsize(vm,NIL(Void_t*)));
|
H A D | tresize.c | 29 Vmalloc_t *vm; local 33 if(!(vm = vmopen(Vmdcsbrk, Vmbest, 0)) ) 36 if(!(dt[0] = vmalloc(vm, 32)) ) 38 if(!(dt[1] = vmalloc(vm, 32)) ) 40 if(!(dt[2] = vmalloc(vm, 32)) ) 42 vmfree(vm,dt[1]); 43 vmfree(vm,dt[2]); 44 if(vmresize(vm, dt[0], 60, 1) != dt[0]) 46 if(vmresize(vm, dt[0], 32, 1) != dt[0]) 49 if(!(dt[1] = vmalloc(vm, 1 [all...] |
H A D | tsmall.c | 24 Vmalloc_t* vm; local 28 if(!(vm = vmopen(Vmdcheap, Vmbest, 0)) ) 31 if(!(addr[0] = vmalloc(vm, 8)) ) 33 if(!(addr[1] = vmalloc(vm, 8)) ) 35 if(!(addr[2] = vmalloc(vm, 8)) ) 38 if(!(addr[3] = vmalloc(vm, 12)) ) 40 if(!(addr[4] = vmalloc(vm, 12)) ) 42 if(!(addr[5] = vmalloc(vm, 12)) ) 45 if(vmfree(vm, addr[1]) < 0) 47 if(vmdbcheck(vm) < [all...] |
H A D | tstat.c | 24 Vmalloc_t* vm; local 28 if(!(vm = vmopen(Vmdcheap,Vmbest,0)) ) 30 if(!(addr = vmalloc(vm,123)) ) 32 if(vmstat(vm,&st) < 0 ) 36 if(vmfree(vm,addr) < 0) 38 if(vmstat(vm,&st) < 0 ) 42 vmclose(vm); 44 if(!(vm = vmopen(Vmdcheap,Vmpool,0)) ) 46 if(!(addr = vmalloc(vm,13)) ) 48 if(vmstat(vm, [all...] |
H A D | tmalloc.c | 24 Vmalloc_t *vm; local 30 if(!(vm = vmopen(Vmdcheap, Vmbest, 0)) ) 34 if(!(addr[i] = vmalloc(vm,15)) ) 37 if(vmfree(vm,addr[i]) < 0) 40 if(!(addr[i] = vmalloc(vm,15)) ) 44 printf("size[%d]=%d\n",i,vmsize(vm,addr[i])); 45 printf("Extent=%d\n",vmsize(vm,NIL(Void_t*)));
|
H A D | tregion.c | 25 Vmalloc_t *vm, *tv; local 29 if(!(vm = vmopen(Vmdcheap,Vmbest,0)) ) 33 { addr[i] = vmalloc(vm,88); 43 { if((tv = vmregion(addr[i])) != vm) 49 vmclose(vm);
|
H A D | talign.c | 25 static Void_t* alignmem(Vmalloc_t* vm, Void_t* ca, size_t cs, size_t ns, Vmdisc_t* dc) argument 27 static Void_t* alignmem(vm, ca, cs, ns, dc) 28 Vmalloc_t* vm; 42 Vmalloc_t* vm; local 46 if(!(vm = vmopen(&Disc,Vmbest,0)) ) 48 if(!(data = vmalign(vm,10,13)) ) 52 vmclose(vm); 54 if(!(vm = vmopen(&Disc,Vmlast,0)) ) 56 if(!(data = vmalign(vm,10,13)) ) 62 if(!(vm [all...] |
H A D | tcompact.c | 26 Void_t* memory(Vmalloc_t* vm, Void_t* caddr, argument 29 Void_t* memory(vm, caddr, oldsize, newsize, disc) 30 Vmalloc_t* vm; 52 Vmalloc_t* vm; local 55 if(!(vm = vmopen(&Disc,Vmbest,0)) ) 59 { addr[i] = vmalloc(vm,15); 65 if(vmfree(vm,addr[i]) < 0) 68 if(!(addr[0] = vmalloc(vm,30)) ) 72 addr[i] = vmalloc(vm,15); 74 if(vmresize(vm,add [all...] |
H A D | tpool.c | 25 Void_t* memory(Vmalloc_t* vm, Void_t* caddr, argument 28 Void_t* memory(vm, caddr, oldsize, newsize, disc) 29 Vmalloc_t* vm; 51 Vmalloc_t* vm; local 54 if(!(vm = vmopen(&Disc,Vmpool,0)) ) 58 { addr[i] = vmalloc(vm,15); 64 if(vmfree(vm,addr[i]) < 0) 68 addr[i] = vmalloc(vm,15); 70 if(vmresize(vm,addr[0],16,1) != NIL(Void_t*)) 73 vmfree(vm,add [all...] |
/ast/src/lib/libast/cdt/ |
H A D | dtnew.c | 25 * dtopen() with handle placed in specific vm region 34 Vmalloc_t* vm; member in struct:Dc_s 51 return vmresize(((Dc_t*)disc)->vm, addr, size, VM_RSMOVE); 55 * open a dictionary using disc->memoryf if set or vm otherwise 59 _dtnew(Vmalloc_t* vm, Dtdisc_t* disc, Dtmethod_t* meth, unsigned long version) argument 69 dc.vm = vm; 78 dtnew(Vmalloc_t* vm, Dtdisc_t* disc, Dtmethod_t* meth) argument 80 return _dtnew(vm, disc, meth, 20050420L);
|
/ast/src/lib/libjcl/ |
H A D | open.c | 44 Vmalloc_t* vm; local 48 if (!(vm = vmopen(Vmdcheap, Vmbest, 0)) || !(vs = vmopen(Vmdcheap, Vmbest, 0))) 51 if (vm) 52 vmclose(vm); 55 if (!(jcl = vmnewof(vm, 0, Jcl_t, 1, 0))) 58 vmclose(vm); 63 jcl->vs = jcl->vm = vm; 88 if (!(jcl->dd = dtnew(jcl->vm, &jcl->dddisc, Dtoset)) || 89 !(jcl->ds = dtnew(jcl->vm, [all...] |