Annotation of parser3/src/lib/gc/include/gc_fake.h, revision 1.1.2.1
1.1.2.1 ! paf 1: #define PA_DEBUG_DISABLE_GC
! 2:
! 3: #include <stdlib.h>
! 4:
! 5: #ifndef __cplusplus
! 6: #define inline __inline
! 7: #endif
! 8:
! 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: }
! 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:
! 26: typedef void * GC_PTR;
! 27: typedef GC_PTR (*GC_fn_type) (GC_PTR client_data);
! 28:
! 29: inline GC_PTR GC_call_with_alloc_lock(GC_fn_type fn, GC_PTR client_data) {
! 30: return(*fn)(client_data);
! 31: }
! 32:
! 33: typedef unsigned long GC_word;
E-mail: