Lines Matching refs:data
90 reg Vmdata_t* vd = vm->data;
99 static void dbwarn(Vmalloc_t* vm, Void_t* data, int where,
102 static void dbwarn(vm, data, where, file, line, func, type)
104 Void_t* data; /* data block */
127 bufp = (*_Vmstrcpy)(bufp, "corrupted data", ':');
135 if(data)
137 bufp = (*_Vmstrcpy)(bufp,(*_Vmitoa)(VLONG(data),0),':');
140 if(!data)
152 bufp = (*_Vmstrcpy)(bufp, (*_Vmitoa)(DBSIZE(data),-1), ':');
165 if((s = DBFILE(data)) && (bufp + strlen(s) + SLOP) < endbuf)
168 bufp = (*_Vmstrcpy)(bufp,(*_Vmitoa)(LONGV(DBLINE(data)),-1),':');
188 static void dbwatch(Vmalloc_t* vm, Void_t* data,
191 static void dbwatch(vm, data, file, line, func, type)
193 Void_t* data;
203 { if(Dbwatch[n] == data)
204 { dbwarn(vm,data,type,file,line,func,DB_WATCH);
212 static void dbsetinfo(Vmuchar_t* data, size_t size, const char* file, int line)
214 static void dbsetinfo(data, size, file, line)
215 Vmuchar_t* data; /* real address not the one from Vmbest */
248 DBSETFL(data,(db ? db->file : NIL(char*)),line);
249 DBSIZE(data) = size;
250 DBSEG(data) = SEG(DBBLOCK(data));
252 DBHEAD(data,begp,endp);
255 DBTAIL(data,begp,endp);
260 /* Check to see if an address is in some data block of a region.
274 reg Vmuchar_t* data;
276 reg Vmdata_t* vd = vm->data;
309 { data = (Vmuchar_t*)DATA(b);
310 if((Vmuchar_t*)addr >= data && (Vmuchar_t*)addr < data+SIZE(b))
312 { data = DB2DEBUG(data);
313 if((Vmuchar_t*)addr >= data &&
314 (Vmuchar_t*)addr < data+DBSIZE(data))
315 offset = (Vmuchar_t*)addr - data;
341 reg Vmdata_t* vd = vm->data;
383 reg Vmuchar_t* data;
387 reg Vmdata_t* vd = vm->data;
407 if(!(data = (Vmuchar_t*)KPVALLOC(vm,s,(*(Vmbest->allocf))) ) )
412 data = DB2DEBUG(data);
413 dbsetinfo(data,size,file,line);
417 (*_Vmtrace)(vm,NIL(Vmuchar_t*),data,size,0);
421 dbwatch(vm,data,file,line,func,DB_ALLOC);
425 ANNOUNCE(0, vm, VM_ALLOC, (Void_t*)data, vm->disc);
427 return (Void_t*)data;
432 static int dbfree(Vmalloc_t* vm, Void_t* data )
434 static int dbfree(vm, data )
436 Void_t* data;
444 reg Vmdata_t* vd = vm->data;
450 if(!data)
465 if((offset = KPVADDR(vm,data,dbaddr)) != 0)
466 { dbwarn(vm,(Vmuchar_t*)data,offset == -1L ? 0 : 1,file,line,func,DB_FREE);
468 (void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc);
475 dbwatch(vm,data,file,line,func,DB_FREE);
479 (*_Vmtrace)(vm,(Vmuchar_t*)data,NIL(Vmuchar_t*),DBSIZE(data),0);
483 ip = (int*)data;
484 endip = ip + (DBSIZE(data)+sizeof(int)-1)/sizeof(int);
488 rv = KPVFREE((vm), (Void_t*)DB2BEST(data), (*Vmbest->freef));
490 ANNOUNCE(0, vm, VM_FREE, data, vm->disc);
501 Void_t* addr; /* old block of data */
506 reg Vmuchar_t* data;
512 reg Vmdata_t* vd = vm->data;
518 data = (Vmuchar_t*)dballoc(vm,size);
551 /* Vmbest data block */
552 data = DB2BEST(addr);
561 data = (Vmuchar_t*)KPVRESIZE(vm,(Void_t*)data,s,
563 if(!data) /* failed, reset data for old block */
568 { data = DB2DEBUG(data);
569 dbsetinfo(data,size,file,line);
573 (*_Vmtrace)(vm,(Vmuchar_t*)addr,data,size,0);
576 dbwatch(vm,data,file,line,func,DB_RESIZED);
580 ANNOUNCE(0, vm, VM_RESIZE, (Void_t*)data, vm->disc);
582 done: if(data && (type&VM_RSZERO) && size > oldsize)
583 { reg Vmuchar_t *d = data+oldsize, *ed = data+size;
587 return (Void_t*)data;
612 reg Vmdata_t* vd = vm->data;
614 /* check the meta-data of this region */
628 { reg Vmuchar_t *data, *begp, *endp;
633 data = DB2DEBUG(DATA(b));
634 if(DBISBAD(data)) /* seen this before */
639 DBHEAD(data,begp,endp);
644 DBTAIL(data,begp,endp);
649 dbwarn(vm,data,begp-data,NIL(char*),0,0,DB_CHECK);
650 DBSETBAD(data);
704 reg Vmuchar_t* data;
709 reg Vmdata_t* vd = vm->data;
729 if(!(data = (Vmuchar_t*)KPVALIGN(vm,s,align,(*(Vmbest->alignf)))) )
732 data += DB_HEAD;
733 dbsetinfo(data,size,file,line);
737 (*_Vmtrace)(vm,NIL(Vmuchar_t*),data,size,align);
742 ANNOUNCE(0, vm, VM_ALLOC, (Void_t*)data, vm->disc);
744 return (Void_t*)data;