mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
fixups for old openbsd system
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28749 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9e4cc4f04e
commit
13da6efeaf
2 changed files with 11 additions and 12 deletions
|
@ -100,14 +100,12 @@ preface.m \
|
||||||
mframe.m
|
mframe.m
|
||||||
|
|
||||||
ifeq ($(findstring openbsd, $(GNUSTEP_TARGET_OS)), openbsd)
|
ifeq ($(findstring openbsd, $(GNUSTEP_TARGET_OS)), openbsd)
|
||||||
GNU_MFILES += thr-pthread.m
|
|
||||||
OBJC_LIBS += -lpthread
|
OBJC_LIBS += -lpthread
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(OBJC_RUNTIME_LIB), gnu)
|
ifneq ($(OBJC_RUNTIME_LIB), gnu)
|
||||||
ifneq ($(OBJC_RUNTIME_LIB), gnugc)
|
ifneq ($(OBJC_RUNTIME_LIB), gnugc)
|
||||||
GNU_MFILES += objc-gnu2next.m
|
GNU_MFILES += objc-gnu2next.m
|
||||||
GNU_MFILES += thr-pthread.m
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -154,24 +154,25 @@
|
||||||
|
|
||||||
- (void) setObject: (id)obj forKey: (id)key cost: (NSUInteger)num
|
- (void) setObject: (id)obj forKey: (id)key cost: (NSUInteger)num
|
||||||
{
|
{
|
||||||
_GSCachedObject *old = [_objects objectForKey: key];
|
_GSCachedObject *oldObject = [_objects objectForKey: key];
|
||||||
|
_GSCachedObject *newObject;
|
||||||
|
|
||||||
if (nil != old)
|
if (nil != oldObject)
|
||||||
{
|
{
|
||||||
[self removeObjectForKey: old->key];
|
[self removeObjectForKey: oldObject->key];
|
||||||
}
|
}
|
||||||
[self _evictObjectsToMakeSpaceForObjectWithCost: num];
|
[self _evictObjectsToMakeSpaceForObjectWithCost: num];
|
||||||
_GSCachedObject *new = [_GSCachedObject new];
|
newObject = [_GSCachedObject new];
|
||||||
// Retained here, released when obj is dealloc'd
|
// Retained here, released when obj is dealloc'd
|
||||||
new->object = RETAIN(obj);
|
newObject->object = RETAIN(obj);
|
||||||
new->key = RETAIN(key);
|
newObject->key = RETAIN(key);
|
||||||
new->cost = num;
|
newObject->cost = num;
|
||||||
if ([obj conformsToProtocol: @protocol(NSDiscardableContent)])
|
if ([obj conformsToProtocol: @protocol(NSDiscardableContent)])
|
||||||
{
|
{
|
||||||
new->isEvictable = YES;
|
newObject->isEvictable = YES;
|
||||||
[_accesses addObject: new];
|
[_accesses addObject: newObject];
|
||||||
}
|
}
|
||||||
[_objects setObject: new forKey: key];
|
[_objects setObject: newObject forKey: key];
|
||||||
RELEASE(obj);
|
RELEASE(obj);
|
||||||
_totalCost += num;
|
_totalCost += num;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue