Back to index

plt-scheme  4.2.1
Classes | Defines | Typedefs | Enumerations | Functions
wxGC.h File Reference
#include "gc.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gc
class  gc_cleanup

Defines

#define WXGC_ATOMIC   (AtomicGC)
#define WXGC_PTRS   (UseGC)
#define WX_REGISTER_GLOBAL_MEMORY
#define wxREGGLOB(x)   scheme_register_static((void *)&x, sizeof(x))
#define gcOBJ_TO_PTR(x)   x
#define gcPTR_TO_OBJ(x)   x
#define START_XFORM_SKIP
#define END_XFORM_SKIP
#define GC_CAN_IGNORE
#define GC_MAYBE_IGNORE_INTERIOR
#define XFORM_OK_PLUS   +
#define XFORM_OK_MINUS   -

Typedefs

typedef void(* GCCleanUpFunc )(void *obj, void *clientData)

Enumerations

enum  GCPlacement {
  UseGC, GC = UseGC, NoGC, PointerFreeGC,
  UseGC, AtomicGC
}

Functions

void objscheme_mark_external_invalid (void *)
void GC_cleanup (void *obj, void *ignored)
void scheme_register_static (void *p, long size)
voidGC_malloc_accounting_shadow (long a)
void GC_free_accounting_shadow (void *a)
voidoperator new (size_t size, GCPlacement gcp)

Define Documentation

#define END_XFORM_SKIP

Definition at line 97 of file wxGC.h.

#define GC_CAN_IGNORE

Definition at line 98 of file wxGC.h.

Definition at line 99 of file wxGC.h.

#define gcOBJ_TO_PTR (   x)    x

Definition at line 88 of file wxGC.h.

#define gcPTR_TO_OBJ (   x)    x

Definition at line 89 of file wxGC.h.

Definition at line 96 of file wxGC.h.

Definition at line 66 of file wxGC.h.

#define WXGC_ATOMIC   (AtomicGC)

Definition at line 40 of file wxGC.h.

#define WXGC_PTRS   (UseGC)

Definition at line 41 of file wxGC.h.

#define wxREGGLOB (   x)    scheme_register_static((void *)&x, sizeof(x))

Definition at line 75 of file wxGC.h.

#define XFORM_OK_MINUS   -

Definition at line 101 of file wxGC.h.

#define XFORM_OK_PLUS   +

Definition at line 100 of file wxGC.h.


Typedef Documentation

typedef void(* GCCleanUpFunc)(void *obj, void *clientData)

Definition at line 44 of file wxGC.h.


Enumeration Type Documentation

Enumerator:
UseGC 
GC 
NoGC 
PointerFreeGC 
UseGC 
AtomicGC 

Definition at line 34 of file wxGC.h.


Function Documentation

void GC_cleanup ( void obj,
void ignored 
)

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:

Definition at line 1441 of file xcglue.c.

{
  Scheme_Class_Object *obj = (Scheme_Class_Object *)sobj;

  obj->primflag = -1;
  obj->primdata = NULL;  
}
void* operator new ( size_t  size,
GCPlacement  gcp 
) [inline]

Definition at line 266 of file wxGC.h.

{
  void *obj;
  
  if (gcp == AtomicGC)
    obj = GC_malloc_atomic(size);
  else
    obj = GC_malloc(size);

  return obj;
}
void scheme_register_static ( void p,
long  size 
)

Definition at line 461 of file salloc.c.

{
#if defined(MZ_PRECISE_GC) || defined(USE_SENORA_GC)
  /* Always register for precise and Senora GC: */
  GC_add_roots((char *)ptr, (char *)(((char *)ptr) + size + 1));
#else
# ifdef GC_MIGHT_USE_REGISTERED_STATICS
  if (use_registered_statics) {
    GC_add_roots((char *)ptr, (char *)(((char *)ptr) + size + 1));
  }
# endif
#endif
}

Here is the call graph for this function: