Changeset 158 for trunk/nom


Ignore:
Timestamp:
Dec 31, 2006, 10:28:58 AM (19 years ago)
Author:
cinc
Message:

Moved garbage collector functions to a separate source file.

Location:
trunk/nom
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/Makefile

    r135 r158  
    3333                        $(OBJDIR)/nombuildnomobj.o \
    3434                        $(OBJDIR)/nombuildnomcls.o \
    35                         $(OBJDIR)/nomid.o
     35                        $(OBJDIR)/nomid.o \
     36                        $(OBJDIR)/nomgc.o
    3637
    3738#                       $(OBJDIR)/nomlistmgr.o \
  • trunk/nom/exports.def

    r135 r158  
    1111
    1212        nomInitGarbageCollection
     13        nomRegisterDataAreaForGC
     14        nomPrintf               
    1315
    14         nomPrintf               
    1516;       somDataResolve  @11
    1617;       somStringFromId @12
  • trunk/nom/idl/nombase.idl

    r139 r158  
    6464
    6565/* Native types we want to use in the IDL */
     66native  gulong;
    6667native  gpointer;
    6768native  PGData;
    68 
     69native  nomId; /* This is a typedef for a GQuark */
    6970#endif /* NOMBASE_IDL_INCLUDED */
  • trunk/nom/include/nom.h

    r139 r158  
    111111typedef GData* PGData;
    112112
    113 typedef gchar **nomID;                 
    114 typedef void *nomToken;                /* Use a gpointer instead of void* here?  */
     113typedef gchar **nomID;                 /* This will be reomoved later. Don't use anymore */
     114typedef void *nomToken;                /* Use a gpointer instead of void* here?          */
    115115
    116116#ifndef NOM_BOOLEAN
  • trunk/nom/src/nomtkinit.c

    r136 r158  
    6262/* Global class manager object */
    6363NOMClassMgr* NOMClassMgrObject; /* Referenced from different files */
    64 gboolean bUseGC=FALSE; /* MArk if we use the garbage collector */
    6564
    6665/********************************************************/
     
    6867/********************************************************/
    6968
    70 static gpointer  gcMalloc(gulong ulBytes)
    71 {
    72   //printf("Hi there...\n");
    73   // return malloc(ulBytes);
    74   return (gpointer) GC_malloc(ulBytes);
    75 }
    76 
    77 static gpointer  gcRealloc(gpointer mem, gulong ulBytes)
    78 {
    79   // printf("...and here\n");
    80   //  return realloc(mem, ulBytes);
    81   return (gpointer) GC_realloc(mem, ulBytes);
    82 }
    83 
    84 static void  gcFree(gpointer mem)
    85 {
    86   //  printf("free(): %x\n", mem);
    87   return;
    88   GC_free(mem);
    89 }
    90 
    91 /*
    92   This is called from the EMX wrapper to set the garbage collector
    93   memory functions as the GLIB default allocation function.
    94  */
    95 void _System  nomInitGarbageCollection()
    96 {
    97  GMemVTable vtbl={0};
    98 
    99  /* Init the garbage collector */
    100  GC_init();
    101 
    102  vtbl.malloc=(gpointer)gcMalloc;
    103  vtbl.realloc=(gpointer)gcRealloc;
    104  vtbl.free=(gpointer)gcFree;
    105 
    106  g_mem_set_vtable(&vtbl);
    107  fprintf(stderr, "   GC memory functions set for GLIB. (%s: %d)\n", __FILE__, __LINE__);
    108  bUseGC=TRUE;
    109 }
    11069
    11170/*
Note: See TracChangeset for help on using the changeset viewer.