-/* find pointer in hash table, add if not exists */
-
-void hash_find(mess,obj) procaddr *mess; virtaddr *obj; {
- int i,first,jump;
- word am;
- first=hash_mess( mess );
- jump=hash_2(first);
- for( i=first; thisp->hash[i]!=0; ){
- if( hash_check_item(thisp->hash[i],mess) ){
- obj->addr=thisp->hash[i];
- obj->mark=M[thisp->hash[i]+1];
- return;
- }
- i=(i+jump)%thisp->hash_size;
- if( i==first ){
- int *curhash=thisp->hash;
- int cursize=thisp->hash_size;
-errsignal(RTEMEMOV); /* the rest is not debugged yet */
- thisp->hash_size = cursize*3-1;
- thisp->hash = mallocate(thisp->hash_size);
- if( thisp->hash==NULL ) errsignal(RTEMEMOV);
- for( i=0; i<thisp->hash_size; i++ ) thisp->hash[i]=0;
- for( i=0; i<cursize; i++ ){
- if( curhash[i]!=0 ){
- virtaddr obj;
- procaddr mess;
- obj.addr=curhash[i];
- obj.mark=M[curhash[i]+1];
- obj2mess(M,&obj,&mess);
- hash_set(&mess,curhash[i]);
- }
- }
- hash_new_item( obj, mess );
- hash_set( mess, obj->addr );
- return;
- }
- }
- /* not exists yet */
- hash_new_item( obj, mess );
- thisp->hash[i]=obj->addr;
+/**
+ * find pointer in hash table, add if not exists
+ */
+void hash_find(procaddr *mess, virtaddr *obj) {
+ int i, first, jump;
+ word am;
+ first = hash_mess(mess);
+ jump = hash_2(first);
+ for (i = first; thisp->hash[i] != 0; ) {
+ if (hash_check_item(thisp->hash[i], mess)) {
+ obj->addr=thisp->hash[i];
+ obj->mark=M[thisp->hash[i] + 1];
+ return;
+ }
+ i = (i + jump) % thisp->hash_size;
+ if (i == first) {
+ int *curhash = thisp->hash;
+ int cursize = thisp->hash_size;
+ /* the rest is not debugged yet */
+ errsignal(RTEMEMOV);
+ thisp->hash_size = cursize * 3 - 1;
+ thisp->hash = mallocate(thisp->hash_size);
+ if(thisp->hash == NULL)
+ errsignal(RTEMEMOV);
+
+ for (i = 0; i < thisp->hash_size; i++)
+ thisp->hash[i] = 0;
+
+ for (i = 0; i < cursize; i++) {
+ if( curhash[i]!=0 ){
+ virtaddr obj;
+ procaddr mess;
+ obj.addr = curhash[i];
+ obj.mark = M[curhash[i] + 1];
+ obj2mess(M, &obj, &mess);
+ hash_set(&mess, curhash[i]);
+ }
+ }
+ hash_new_item(obj, mess);
+ hash_set(mess, obj->addr);
+ return;
+ }
+ }
+ /* not exists yet */
+ hash_new_item(obj, mess);
+ thisp->hash[i] = obj->addr;