예제 #1
0
파일: pipe.c 프로젝트: Fadekraft/MollenOS
static void
ReclaimSegment(
    _In_ SystemPipeSegment_t*       Segment)
{
    int References = atomic_fetch_sub(&Segment->References, 1) - 1;
    if (References == 0) {
        DestroySegment(Segment);
    }
}
예제 #2
0
void hypre_UnorderedIntMapDestroy( hypre_UnorderedIntMap *m)
{
  hypre_TFree(m->table);

#ifdef HYPRE_CONCURRENT_HOPSCOTCH
  HYPRE_Int i;
  for (i = 0; i <= m->segmentMask; i++)
  {
    DestroySegment(&m->segments[i]);
  }
  hypre_TFree(m->segments);
#endif
}
예제 #3
0
void hypre_UnorderedIntSetDestroy( hypre_UnorderedIntSet *s )
{
  hypre_TFree(s->hopInfo);
  hypre_TFree(s->key);
  hypre_TFree(s->hash);

#ifdef HYPRE_CONCURRENT_HOPSCOTCH
  HYPRE_Int i;
  for (i = 0; i <= s->segmentMask; i++)
  {
    DestroySegment(&s->segments[i]);
  }
  hypre_TFree(s->segments);
#endif
}
예제 #4
0
파일: Shmem.cpp 프로젝트: lofter2011/Icefox
// static
void
Shmem::Dealloc(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
               SharedMemory* aSegment)
{
  if (!aSegment)
    return;

  size_t pageSize = SharedMemory::SystemPageSize();
  char *frontSentinel;
  char *data;
  char *backSentinel;
  GetSections(aSegment, &frontSentinel, &data, &backSentinel);

  aSegment->Protect(frontSentinel, pageSize, RightsWrite | RightsRead);
  Header* header = reinterpret_cast<Header*>(frontSentinel);
  memset(header->mMagic, 0, sizeof(sMagic));
  header->mSize = 0;

  DestroySegment(aSegment);
}
예제 #5
0
// static
void
Shmem::Dealloc(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
               SharedMemory* aSegment)
{
  if (!aSegment)
    return;

  size_t pageSize = SharedMemory::SystemPageSize();
  Header* header;
  char *frontSentinel;
  char *data;
  char *backSentinel;
  GetSections(aSegment, &header, &frontSentinel, &data, &backSentinel);

  aSegment->Protect(frontSentinel, pageSize, RightsWrite | RightsRead);
  memset(header->mMagic, 0, sizeof(sMagic));
  header->mSize = 0;
  header->mUnsafe = false;          // make it "safe" so as to catch errors

  DestroySegment(aSegment);
}
예제 #6
0
// static
void
Shmem::Dealloc(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
               SharedMemory* aSegment)
{
  DestroySegment(aSegment);
}