Annotation of parser3/src/lib/gc/include/gc.h, revision 1.1.2.2

1.1.2.2 ! paf         1: #define PA_DEBUG_DISABLE_GC
1.1.2.1   paf         2: 
1.1.2.2 ! paf         3: #include <stdlib.h>
1.1.2.1   paf         4: 
1.1.2.2 ! paf         5: #ifndef __cplusplus
        !             6: #define inline __inline
1.1.2.1   paf         7: #endif
                      8: 
1.1.2.2 ! paf         9: inline void *GC_MALLOC(size_t size) {
        !            10:        return calloc(size,1);
        !            11: }
        !            12: inline void *GC_MALLOC_ATOMIC(size_t size) {
        !            13:        return malloc(size);
        !            14: }
        !            15: inline void *GC_REALLOC(void *ptr, size_t size) {
        !            16:        return realloc(ptr, size);
        !            17: }
        !            18: inline void GC_FREE(void *ptr) {
        !            19:        free(ptr);
        !            20: }
1.1.2.1   paf        21: 
                     22: 
                     23: # define GC_NEW(t) (t *)GC_MALLOC(sizeof (t))
                     24: # define GC_NEW_ATOMIC(t) (t *)GC_MALLOC_ATOMIC(sizeof (t))
                     25: 
1.1.2.2 ! paf        26: typedef void * GC_PTR;
        !            27: typedef GC_PTR (*GC_fn_type) (GC_PTR client_data);
1.1.2.1   paf        28: 
1.1.2.2 ! paf        29: inline GC_PTR GC_call_with_alloc_lock(GC_fn_type fn, GC_PTR client_data) {
        !            30:        return(*fn)(client_data);
        !            31: }
1.1.2.1   paf        32: 
1.1.2.2 ! paf        33: typedef unsigned long GC_word;

E-mail: