#ifndef GC_AMIGA_ONLYFAST
if(GC_amiga_dontalloc==TRUE){
-// printf("rejected, size: %d, latestsize: %d\n",size,latestsize);
return NULL;
}
- // We really don't want to use chip-mem, but if we must, then as little as possible.
+ /* We really don't want to use chip-mem, but if we must, then as little as possible. */
if(GC_AMIGA_MEMF==(MEMF_ANY|MEMF_CLEAR) && size>100000 && latestsize<50000) return NULL;
#endif
gc_am->size=size + sizeof(struct GC_Amiga_AllocedMemoryHeader);
GC_AMIGAMEM=(struct GC_Amiga_AllocedMemoryHeader *)(~(int)(gc_am));
-// printf("Allocated %d (%d) bytes at address: %x. Latest: %d\n",size,tot,gc_am,latestsize);
-
#ifdef GC_AMIGA_PRINTSTATS
if((char *)gc_am<chipmax){
allochip+=size;
if (((char *)ret)<=chipmax && ret!=NULL && (rec<(size>500000?9:size/5000))){
ret=GC_amiga_rec_alloc(size,AllocFunction,rec+1);
-// GC_free(ret2);
}
return ret;
void *GC_amiga_allocwrapper_any(size_t size,void *(*AllocFunction)(size_t size2)){
void *ret;
- GC_amiga_dontalloc=TRUE; // Pretty tough thing to do, but its indeed necessary.
+ GC_amiga_dontalloc=TRUE; /* Pretty tough thing to do, but its indeed necessary. */
latestsize=size;
ret=(*AllocFunction)(size);
if(((char *)ret) <= chipmax){
if(ret==NULL){
- //Give GC access to allocate memory.
+ /* Give GC access to allocate memory. */
#ifdef GC_AMIGA_GC
if(!GC_dont_gc){
GC_gcollect();
/* We got chip-mem. Better try again and again and again etc., we might get fast-mem sooner or later... */
/* Using gctest to check the effectiveness of doing this, does seldom give a very good result. */
/* However, real programs doesn't normally rapidly allocate and deallocate. */
-// printf("trying to force... %d bytes... ",size);
if(
AllocFunction!=GC_malloc_uncollectable
#ifdef GC_ATOMIC_UNCOLLECTABLE
#endif
}
if(((char *)ret2)>chipmax){
-// printf("Succeeded.\n");
GC_free(ret);
ret=ret2;
}else{
GC_free(ret2);
-// printf("But did not succeed.\n");
}
}
#endif
GC_amiga_toany=func;
}
-#endif // !GC_AMIGA_ONLYFAST
+#endif /* !GC_AMIGA_ONLYFAST */
void *GC_amiga_allocwrapper_fast(size_t size,void *(*AllocFunction)(size_t size2)){
ret=(*AllocFunction)(size);
if(ret==NULL){
- // Enable chip-mem allocation.
-// printf("ret==NULL\n");
+ /* Enable chip-mem allocation. */
#ifdef GC_AMIGA_GC
if(!GC_dont_gc){
GC_gcollect();
void *GC_amiga_allocwrapper_firsttime(size_t size,void *(*AllocFunction)(size_t size2)){
atexit(&GC_amiga_free_all_mem);
- chipmax=(char *)SysBase->MaxLocMem; // For people still having SysBase in chip-mem, this might speed up a bit.
+ chipmax=(char *)SysBase->MaxLocMem; /* For people still having SysBase in chip-mem, this might speed up a bit. */
GC_amiga_allocwrapper_do=GC_amiga_allocwrapper_fast;
return GC_amiga_allocwrapper_fast(size,AllocFunction);
}
-#endif //GC_AMIGA_FASTALLOC
+#endif /* GC_AMIGA_FASTALLOC */
#endif
}
-#endif //GC_AMIGA_AM
+#endif /* GC_AMIGA_AM */
#include "gc.h"
#include "private/gc_priv.h"
-// use 'CODE' resource 0 to get exact location of the beginning of global space.
+/* use 'CODE' resource 0 to get exact location of the beginning of global space. */
typedef struct {
unsigned long aboveA5;
if (clearMemory) memset(tempPtr, 0, size);
tempPtr = StripAddress(tempPtr);
- // keep track of the allocated blocks.
+ /* keep track of the allocated blocks. */
(**tempMemBlock).nextBlock = theTemporaryMemory;
theTemporaryMemory = tempMemBlock;
}
# if !defined(SHARED_LIBRARY_BUILD)
- // install an exit routine to clean up the memory used at the end.
+ /* install an exit routine to clean up the memory used at the end. */
if (firstTime) {
atexit(&GC_MacFreeTemporaryMemory);
firstTime = false;
/* Boehm, November 17, 1995 12:10 pm PST */
#ifdef __MWERKS__
-
-// for CodeWarrior Pro with Metrowerks Standard Library (MSL).
-// #define MSL_USE_PRECOMPILED_HEADERS 0
+/* for CodeWarrior Pro with Metrowerks Standard Library (MSL). */
+/* #define MSL_USE_PRECOMPILED_HEADERS 0 */
#include <ansi_prefix.mac.h>
#endif /* __MWERKS__ */
-// these are defined again in gc_priv.h.
+/* these are defined again in gc_priv.h. */
#undef TRUE
#undef FALSE
-#define ALL_INTERIOR_POINTERS // follows interior pointers.
-//#define DONT_ADD_BYTE_AT_END // no padding.
-//#define SMALL_CONFIG // whether to use a smaller heap.
-#define USE_TEMPORARY_MEMORY // use Macintosh temporary memory.
+#define ALL_INTERIOR_POINTERS /* follows interior pointers. */
+/* #define DONT_ADD_BYTE_AT_END */ /* no padding. */
+/* #define SMALL_CONFIG */ /* whether to use a smaller heap. */
+#define USE_TEMPORARY_MEMORY /* use Macintosh temporary memory. */