unsigned int maj_dev;
ptr_t least_ha, greatest_ha;
unsigned i;
- ptr_t datastart;
-
-# ifdef DATASTART_IS_FUNC
- static ptr_t datastart_cached = (ptr_t)(word)-1;
-
- /* Evaluate DATASTART only once. */
- if (datastart_cached == (ptr_t)(word)-1) {
- datastart_cached = DATASTART;
- }
- datastart = datastart_cached;
-# else
- datastart = DATASTART;
-# endif
GC_ASSERT(I_HOLD_LOCK());
sort_heap_sects(GC_our_memory, GC_n_memory);
BPTR myseglist;
ULONG *data;
- int num;
-
-
# ifdef __GNUC__
ULONG dataSegSize;
GC_bool found_segment = FALSE;
/* xoper hunks Shell Process */
- num=0;
for (data = (ULONG *)BADDR(myseglist); data != NULL;
data = (ULONG *)BADDR(data[0])) {
if (((ULONG) GC_register_data_segments < (ULONG) &data[1]) ||
GC_add_roots_inner((char *)&data[1],
((char *)&data[1]) + data[-1], FALSE);
}
- ++num;
} /* for */
# ifdef __GNUC__
if (!found_segment) {
};
static TemporaryMemoryHandle theTemporaryMemory = NULL;
-static Boolean firstTime = true;
void GC_MacFreeTemporaryMemory(void);
Ptr GC_MacTemporaryNewPtr(size_t size, Boolean clearMemory)
{
+# if !defined(SHARED_LIBRARY_BUILD)
static Boolean firstTime = true;
+# endif
OSErr result;
TemporaryMemoryHandle tempMemBlock;
Ptr tempPtr = nil;
# endif
if (theTemporaryMemory != NULL) {
+# if !defined(SHARED_LIBRARY_BUILD)
long totalMemoryUsed = 0;
+# endif
TemporaryMemoryHandle tempMemBlock = theTemporaryMemory;
while (tempMemBlock != NULL) {
TemporaryMemoryHandle nextBlock = (**tempMemBlock).nextBlock;
+# if !defined(SHARED_LIBRARY_BUILD)
totalMemoryUsed += GetHandleSize((Handle)tempMemBlock);
+# endif
DisposeHandle((Handle)tempMemBlock);
tempMemBlock = nextBlock;
}
# if !defined(SHARED_LIBRARY_BUILD)
if (GC_print_stats) {
fprintf(stdout, "[total memory used: %ld bytes.]\n",
- totalMemoryUsed);
+ totalMemoryUsed);
fprintf(stdout, "[total collections: %lu]\n",
(unsigned long)GC_gc_no);
}
size = (GC_ULONG_PTR)end < (GC_ULONG_PTR)buffer ? 0 : end - buffer;
buffer += GetModuleNameFromAddress(address, buffer, size);
- size = (GC_ULONG_PTR)end < (GC_ULONG_PTR)buffer ? 0 : end - buffer;
-
return buffer - begin;
}