mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
garbage collection tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32425 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
36369bf334
commit
7cf4d2bb21
3 changed files with 14 additions and 11 deletions
|
@ -615,8 +615,9 @@ NewUTF8STR(const void *ptr, int len)
|
|||
return s;
|
||||
}
|
||||
|
||||
typedef struct NSXMLParserIvarsType
|
||||
@interface GSXMLParserIvars : NSObject
|
||||
{
|
||||
@public
|
||||
NSMutableArray *tagPath; // hierarchy of tags
|
||||
NSMutableArray *namespaces;
|
||||
NSMutableDictionary *defaults;
|
||||
|
@ -643,8 +644,10 @@ typedef struct NSXMLParserIvarsType
|
|||
IMP foundCharacters;
|
||||
IMP foundComment;
|
||||
IMP foundIgnorable;
|
||||
|
||||
} NSXMLParserIvars;
|
||||
}
|
||||
@end
|
||||
@implementation GSXMLParserIvars
|
||||
@end
|
||||
|
||||
static SEL didEndElementSel = 0;
|
||||
static SEL didEndMappingPrefixSel;
|
||||
|
@ -665,7 +668,7 @@ static SEL foundIgnorableSel;
|
|||
|
||||
#define _parser (self->_parser)
|
||||
#define _handler (self->_handler)
|
||||
#define this ((NSXMLParserIvars*)_parser)
|
||||
#define this ((GSXMLParserIvars*)_parser)
|
||||
#define _del ((id)_handler)
|
||||
|
||||
+ (void) initialize
|
||||
|
@ -714,7 +717,7 @@ static SEL foundIgnorableSel;
|
|||
RELEASE(this->tagPath);
|
||||
RELEASE(this->namespaces);
|
||||
RELEASE(this->defaults);
|
||||
NSZoneFree([self zone], this);
|
||||
[this release];
|
||||
_parser = 0;
|
||||
_handler = 0;
|
||||
}
|
||||
|
@ -744,8 +747,7 @@ static SEL foundIgnorableSel;
|
|||
{
|
||||
NSStringEncoding enc;
|
||||
|
||||
_parser = NSZoneMalloc([self zone], sizeof(NSXMLParserIvars));
|
||||
memset(_parser, '\0', sizeof(NSXMLParserIvars));
|
||||
_parser = [GSXMLParserIvars new];
|
||||
/* Determine character encoding and convert to utf-8 if needed.
|
||||
*/
|
||||
enc = [GSMimeDocument encodingFromCharset:
|
||||
|
|
|
@ -4,12 +4,13 @@
|
|||
int
|
||||
main()
|
||||
{
|
||||
START_SET("Garbage collection");
|
||||
NSGarbageCollector *collector;
|
||||
NSZone *z;
|
||||
|
||||
collector = [NSGarbageCollector defaultCollector];
|
||||
if (collector == nil) SKIP("GNUstep was not built for Garbage collection")
|
||||
if (collector == nil) return 0;
|
||||
|
||||
START_SET("Garbage collection");
|
||||
|
||||
PASS([collector zone] == NSDefaultMallocZone(),
|
||||
"collector zone is default")
|
||||
|
|
|
@ -35,10 +35,10 @@ main()
|
|||
NSNotificationCenter *center;
|
||||
MyClass *object;
|
||||
|
||||
START_SET("Garbage Collection");
|
||||
collector = [NSGarbageCollector defaultCollector];
|
||||
if (collector == nil) SKIP("GNUstep was not built for Garbage collection")
|
||||
if (collector == nil) return 0;
|
||||
|
||||
START_SET("Garbage Collection");
|
||||
center = [NSNotificationCenter defaultCenter];
|
||||
object = [MyClass new];
|
||||
[center addObserver: object
|
||||
|
|
Loading…
Reference in a new issue