Esempio n. 1
0
void
hash_Print (
  pwr_tStatus		*sts,
  hash_sTable		*htp
)
{
  hash_sGtable		*ghtp;


  ghtp = htp->ghtp;

  printf("  size............: %zd\n", ghtp->size);
  printf("  key_size........: %zd\n", ghtp->key_size);
  printf("  record_size.....: %zd\n", ghtp->record_size);
  printf("  key_offset......: %d\n", (int)ghtp->key_offset);
  printf("  link_offset.....: %d\n", (int)ghtp->link_offset);
  printf("  key_type........: %d\n", ghtp->key_type);
  printf("  xforms..........: %d\n", ghtp->xforms);
  printf("  comps...........: %d\n", ghtp->comps);
  printf("  max_depth.......: %d\n", ghtp->max_depth);
  printf("  mean_depth......: %f\n", (float)ghtp->comps/(float)ghtp->xforms);
  printf("  inserts.........: %d\n", ghtp->inserts);
  printf("  removes.........: %d\n", ghtp->removes);
  printf("  searchs.........: %d\n", ghtp->searchs);
  printf("  used_buckets....: %d\n", ghtp->used_buckets);
  printf("  max_used_buckets: %d\n", ghtp->max_used_buckets);
  printf("  entries.........: %d\n", ghtp->entries);
  printf("  max_entries.....: %d\n", ghtp->max_entries);
  printf("  finds...........: %d\n", ghtp->finds);
  printf("  no_finds........: %d\n", ghtp->no_finds);
  printf("  inits...........: %d\n", ghtp->inits);

  pwr_Status(sts, HASH__SUCCESS);
}
Esempio n. 2
0
void
dl_Cancel (
  pwr_tStatus		*sts,
  pwr_tDlid		dlid
)
{
  dl_sLink		*dp;
  gdb_sObject		*op;
  cdh_uRefId		rid;

  gdb_AssumeLocked;
  
  rid.pwr = dlid;
  if (rid.r.vid_3 != cdh_eVid3_dlid) {
    pwr_Status(sts, GDH__DLID);
    return;
  }

  dp = hash_Search(sts, gdbroot->subc_ht, &dlid);
  if (dp == NULL) {
    pwr_Status(sts, GDH__DLID);
    return;
  }

  dp = hash_Remove(sts, gdbroot->subc_ht, dp);
  if (dp == NULL) errh_Bugcheck(GDH__WEIRD, "hash_Remove");

  pool_Qremove(NULL, gdbroot->pool, &dp->dl_ll);
  gdbroot->db->dl_lc--;

  op = pool_Address(NULL, gdbroot->pool, dp->opr);
  if (op == NULL) errh_Bugcheck(GDH__WEIRD, "direct link inconsitency");

  gdb_UnlockObject(sts, op);

  pool_Free(NULL, gdbroot->pool, dp);

  return;
}