Differences From Artifact [77883af432]:
- File
src/OFApplication.m
— part of check-in
[1255f3a11a]
at
2012-08-10 20:08:24
on branch trunk
— Directly use the runtime's autorelease pools.
This greatly improves performance, as it gets rid of the overhead of
OFAutoreleasePool. (user: js, size: 6300) [annotate] [blame] [check-ins using]
To Artifact [93776e4552]:
- File src/OFApplication.m — part of check-in [3659c87c63] at 2012-09-06 19:13:50 on branch trunk — Add -[OFString initWithUTF8String:freeWhenDone:]. (user: js, size: 6681) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
164 165 166 167 168 169 170 | * iOS does not provide environ and Apple does not allow using * _NSGetEnviron on iOS. Therefore, we just get a few common * variables from the environment which applications might * expect. */ pool = objc_autoreleasePoolPush(); | | > > > | < | > | > > > | < | > | > > > | < | > | > > > | < | > | > > > | < | > | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | * iOS does not provide environ and Apple does not allow using * _NSGetEnviron on iOS. Therefore, we just get a few common * variables from the environment which applications might * expect. */ pool = objc_autoreleasePoolPush(); if ((env = getenv("HOME")) != NULL) { OFString *home = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: NO] autorelease]; [environment setObject: home forKey: @"HOME"]; } if ((env = getenv("PATH")) != NULL) { OFString *path = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: NO] autorelease]; [environment setObject: path forKey: @"PATH"]; } if ((env = getenv("SHELL")) != NULL) { OFString *shell = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: NO] autorelease]; [environment setObject: shell forKey: @"SHELL"]; } if ((env = getenv("TMPDIR")) != NULL) { OFString *tmpdir = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: NO] autorelease]; [environment setObject: tmpdir forKey: @"TMPDIR"]; } if ((env = getenv("USER")) != NULL) { OFString *user = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: NO] autorelease]; [environment setObject: user forKey: @"USER"]; } objc_autoreleasePoolPop(pool); #endif [environment makeImmutable]; } @catch (id e) { [self release]; |
︙ | ︙ |