Beispiel #1
0
int
destroySourceFile(SourceFile sf)
{ DEBUG(MSG_SRCFILE,
	Sdprintf("Destroying source file %s\n", PL_atom_chars(sf->name)));

  clearSourceAdmin(sf);

  LOCK();
  if ( sf->magic == SF_MAGIC )
  { SourceFile f;

    sf->magic = SF_MAGIC_DESTROYING;
    f = deleteHTable(GD->files.table, (void*)sf->name);
    assert(f);
    PL_unregister_atom(sf->name);
    putSourceFileArray(sf->index, NULL);
    if ( GD->files.no_hole_before > sf->index )
      GD->files.no_hole_before = sf->index;
  }
  UNLOCK();

  unallocSourceFile(sf);

  return TRUE;
}
Beispiel #2
0
static void
freeSymbolSourceFile(void *name, void *value)
{ SourceFile sf = value;

  if ( sf->magic == SF_MAGIC )
    sf->magic = SF_MAGIC_DESTROYING;
  unallocSourceFile(sf);
}
Beispiel #3
0
int
destroySourceFile(SourceFile sf)
{ Symbol s;

  DEBUG(MSG_SRCFILE,
	Sdprintf("Destroying source file %s\n", PL_atom_chars(sf->name)));

  clearSourceAdmin(sf);

  LOCK();
  s = lookupHTable(GD->files.table, (void*)sf->name);
  assert(s);
  deleteSymbolHTable(GD->files.table, s);
  PL_unregister_atom(sf->name);
  putSourceFileArray(sf->index, NULL);
  if ( GD->files.no_hole_before > sf->index )
    GD->files.no_hole_before = sf->index;
  UNLOCK();

  unallocSourceFile(sf);

  return TRUE;
}
Beispiel #4
0
static void
freeSymbolSourceFile(Symbol s)
{ SourceFile sf = s->value;

  unallocSourceFile(sf);
}