Back to index

plt-scheme  4.2.1
Defines | Functions | Variables
wxGC.cxx File Reference
#include <stddef.h>
#include "wxGC.h"

Go to the source code of this file.

Defines

#define DONT_DEFINE_BUILTIN_NEW
#define CAST_GCP   /* empty */
#define CAST_GCPP   /* empty */
#define ALLOW_NON_BASE   1
#define CHECK_BASE   0
#define SHOW_CLEANUP_TIMES   0
#define INIT_ACCUM_SIZE   1024 * 1024 * 5
#define INIT_ACCUM_COUNT   1000

Functions

void GC_cleanup (void *obj, void *)
voidGC_malloc_accounting_shadow (long a)
void GC_free_accounting_shadow (void *p)

Variables

static long total
static long accum = INIT_ACCUM_SIZE
static int total_count
static int accum_count = INIT_ACCUM_COUNT

Define Documentation

#define ALLOW_NON_BASE   1
#define CAST_GCP   /* empty */

Definition at line 60 of file wxGC.cxx.

#define CAST_GCPP   /* empty */

Definition at line 61 of file wxGC.cxx.

#define CHECK_BASE   0

Definition at line 45 of file wxGC.cxx.

#define INIT_ACCUM_COUNT   1000

Definition at line 378 of file wxGC.cxx.

#define INIT_ACCUM_SIZE   1024 * 1024 * 5

Definition at line 377 of file wxGC.cxx.

#define SHOW_CLEANUP_TIMES   0

Definition at line 154 of file wxGC.cxx.


Function Documentation

void GC_cleanup ( void obj,
void  
)

Definition at line 160 of file wxGC.cxx.

{
  gc *clean = (gc *)gcPTR_TO_OBJ(obj);

#ifdef MZ_PRECISE_GC
# ifdef COMPACT_BACKTRACE_GC  
#  if SHOW_CLEANUP_TIMES
  long start;
  start = scheme_get_process_milliseconds();
  char *s;
  s = clean->gcGetName();
  printf("Cleanup: %s\n", s ? s : "???");
#  endif
# endif

  GC_cpp_delete(clean);

# ifdef COMPACT_BACKTRACE_GC  
#  if SHOW_CLEANUP_TIMES
  start = scheme_get_process_milliseconds() - start;
  printf("  done %d\n", start);
#  endif
# endif
#else
  clean->~gc();
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 413 of file wxGC.cxx.

{
  if (p) {
    total -= *(long *)p;
    accum += *(long *)p;
    total_count -= 1;
    accum_count += 1;
  }
}

Here is the caller graph for this function:

Definition at line 383 of file wxGC.cxx.

{
  long *p;
  if (a < (long)sizeof(long))
    a = sizeof(long);
  total += a;
  accum -= a;
  total_count += 1;
  accum_count -= 1;
  if (accum <= 0) {
    GC_gcollect();
    accum = total >> 1;
    if (accum < INIT_ACCUM_SIZE)
      accum = INIT_ACCUM_SIZE;
  }
#ifdef wx_msw
  /* Under Windows, the number of bitmaps matters, even if
     they're small. */
  if (accum_count <= 0) {
    GC_gcollect();
    accum_count = total_count >> 1;
    if (accum_count < INIT_ACCUM_COUNT)
      accum_count = INIT_ACCUM_COUNT;
  }
#endif
  p = (long *)GC_malloc_atomic(a);
  *p = a;
  return (void *)p;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

long accum = INIT_ACCUM_SIZE [static]

Definition at line 380 of file wxGC.cxx.

Definition at line 381 of file wxGC.cxx.

long total [static]

Definition at line 380 of file wxGC.cxx.

int total_count [static]

Definition at line 381 of file wxGC.cxx.