mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
tweak GC for improved performance and debugging
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28129 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4e2efb55dc
commit
0807ecd3d6
2 changed files with 8 additions and 2 deletions
|
@ -4,6 +4,8 @@
|
||||||
* Source/GSSocketStream.m:
|
* Source/GSSocketStream.m:
|
||||||
Avoid unnecessary memory allocation.
|
Avoid unnecessary memory allocation.
|
||||||
Use weak pointers to break finalisation cycles.
|
Use weak pointers to break finalisation cycles.
|
||||||
|
* Source/NSZone.m: Use GC debug unless built with 'debug=no'
|
||||||
|
Allocate memory ignoring pointers into the allocated data.
|
||||||
|
|
||||||
2009-03-21 Richard Frith-Macdonald <rfm@gnu.org>
|
2009-03-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -1753,6 +1753,10 @@ NSReallocateCollectable(void *ptr, NSUInteger size, NSUInteger options)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if defined(DEBUG)
|
||||||
|
#define GC_DEBUG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <gc.h>
|
#include <gc.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1784,7 +1788,7 @@ NSAllocateCollectable(NSUInteger size, NSUInteger options)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptr = (void*)GC_MALLOC(size);
|
ptr = (void*)GC_MALLOC_IGNORE_OFF_PAGE(size);
|
||||||
memset(ptr, '\0', size);
|
memset(ptr, '\0', size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1796,7 +1800,7 @@ NSAllocateCollectable(NSUInteger size, NSUInteger options)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ptr = (void*)GC_MALLOC_ATOMIC(size);
|
ptr = (void*)GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(size);
|
||||||
memset(ptr, '\0', size);
|
memset(ptr, '\0', size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue