示例#1
0
文件: sc.c 项目: johannrudi/libsc
void
sc_free (int package, void *ptr)
{
  if (ptr == NULL) {
    return;
  }
  else {
    /* uncount the allocations */
    int                *free_count = sc_free_count (package);

#ifdef SC_ENABLE_PTHREAD
    sc_package_lock (package);
#endif
    ++*free_count;
#ifdef SC_ENABLE_PTHREAD
    sc_package_unlock (package);
#endif
  }

  /* free memory */
#if defined SC_ENABLE_MEMALIGN
  sc_free_aligned (ptr, SC_MEMALIGN_BYTES);
#else
  free (ptr);
#endif
}
示例#2
0
文件: sc.c 项目: Weischer/libsc
void
sc_free (int package, void *ptr)
{
  if (ptr != NULL) {
    int                *free_count = sc_free_count (package);

    ++*free_count;
  }
  free (ptr);
}
示例#3
0
文件: sc.c 项目: aseyboldt/libsc
void
sc_free (int package, void *ptr)
{
  if (ptr != NULL) {
    int                *free_count = sc_free_count (package);
    ++*free_count;

#ifdef SC_ALLOC_ALIGN
    ptr = (void *) ((size_t *) ptr)[-1];
    SC_ASSERT (ptr != NULL);
#endif
  }
  free (ptr);
}
示例#4
0
文件: sc.c 项目: holke/libsc
void
sc_free (int package, void *ptr)
{
  if (ptr != NULL) {
    int                *free_count = sc_free_count (package);

#ifdef SC_ENABLE_PTHREAD
    sc_package_lock (package);
#endif
    ++*free_count;
#ifdef SC_ENABLE_PTHREAD
    sc_package_unlock (package);
#endif
  }
  free (ptr);
}