fixes for new release

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/performance/trunk@36997 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-08-21 08:47:28 +00:00
parent eabad6c509
commit 62959bec70
4 changed files with 48 additions and 40 deletions

View file

@ -1,3 +1,11 @@
2013-08-21 Richard Frith-Macdonald <rfm@gnu.org>
* GSFIFO.m: 64bit printf format changes
* GSSkipMutableArray.m: 64bit printf format changes
* GSCache.m: Fix mime size calculations for nonfragile abi.
Change API to use NSUInteger for sizes
* GNUmakefile: bump version fro new release
2013-06-25 Richard Frith-Macdonald <rfm@gnu.org>
* GNUmakefile: bump subminor version

View file

@ -21,8 +21,8 @@ include $(GNUSTEP_MAKEFILES)/common.make
-include config.make
PACKAGE_NAME = Performance
PACKAGE_VERSION = 0.3.3
Performance_INTERFACE_VERSION=0.3
PACKAGE_VERSION = 0.4.0
Performance_INTERFACE_VERSION=0.4
SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/libs
SVN_MODULE_NAME = performance

View file

@ -82,7 +82,7 @@
/**
* Return the total size of the objects currently in the cache.
*/
- (unsigned) currentSize;
- (NSUInteger) currentSize;
/**
* Return the delegate object previously set using the -setDelegate: method.
@ -110,7 +110,7 @@
* Return the maximum tital size of items in the cache.<br />
* A value of zero means there is no limit.
*/
- (unsigned) maxSize;
- (NSUInteger) maxSize;
/**
* Return the name of this instance (as set using -setName:)
@ -159,7 +159,7 @@
* then an attempt to set an object whose size would exceed the cache limit
* will result in the least recently used items in the cache being removed.
*/
- (void) setMaxSize: (unsigned)max;
- (void) setMaxSize: (NSUInteger)max;
/**
* Sets the name of this instance.
@ -209,7 +209,7 @@
* The size argument is used <em>only</em> if a maximum size is set
* for the cache.
*/
- (void) shrinkObjects: (unsigned)objects andSize: (unsigned)size;
- (void) shrinkObjects: (unsigned)objects andSize: (NSUInteger)size;
@end
/**
@ -277,9 +277,9 @@
* </p>
* For example:
* <example>
* - (unsigned) sizeInBytes: (NSMutableSet*)exclude
* - (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
* {
* unsigned size = [super sizeInBytes: exclude];
* NSUInteger size = [super sizeInBytes: exclude];
* if (size > 0)
* {
* size += [myInstanceVariable sizeInBytes: exclude];
@ -311,7 +311,7 @@
* to hold all the instance variables defined for the receiver's class
* including all superclasses).
*/
- (unsigned) sizeInBytes: (NSMutableSet*)exclude;
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude;
@end
#endif

View file

@ -65,7 +65,7 @@
unsigned life;
unsigned warn;
unsigned when;
unsigned size;
NSUInteger size;
id key;
id object;
}
@ -102,10 +102,10 @@ typedef struct {
void (*refresh)(id, SEL, id, id, unsigned, unsigned);
BOOL (*replace)(id, SEL, id, id, unsigned, unsigned);
unsigned currentObjects;
unsigned currentSize;
NSUInteger currentSize;
unsigned lifetime;
unsigned maxObjects;
unsigned maxSize;
NSUInteger maxSize;
unsigned hits;
unsigned misses;
NSMapTable *contents;
@ -230,7 +230,7 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
return my->currentObjects;
}
- (unsigned) currentSize
- (NSUInteger) currentSize
{
return my->currentSize;
}
@ -269,7 +269,7 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
n = [NSString stringWithFormat:
@" %@\n"
@" Items: %u(%u)\n"
@" Size: %u(%u)\n"
@" Size: %"PRIuPTR"(%"PRIuPTR")\n"
@" Life: %u\n"
@" Hit: %u\n"
@" Miss: %u\n",
@ -310,7 +310,7 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
return my->maxObjects;
}
- (unsigned) maxSize
- (NSUInteger) maxSize
{
return my->maxSize;
}
@ -568,7 +568,7 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
[my->lock unlock];
}
- (void) setMaxSize: (unsigned)max
- (void) setMaxSize: (NSUInteger)max
{
[my->lock lock];
if (max > 0 && my->maxSize == 0)
@ -576,7 +576,7 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
NSMapEnumerator e = NSEnumerateMapTable(my->contents);
GSCacheItem *i;
id k;
unsigned size = 0;
NSUInteger size = 0;
if (my->exclude == nil)
{
@ -638,9 +638,9 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
{
GSCacheItem *item;
unsigned maxObjects;
unsigned maxSize;
NSUInteger maxSize;
unsigned addObjects = (anObject == nil ? 0 : 1);
unsigned addSize = 0;
NSUInteger addSize = 0;
[my->lock lock];
maxObjects = my->maxObjects;
@ -730,9 +730,9 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
}
}
- (void) shrinkObjects: (unsigned)objects andSize: (unsigned)size
- (void) shrinkObjects: (unsigned)objects andSize: (NSUInteger)size
{
unsigned newSize;
NSUInteger newSize;
unsigned newObjects;
[my->lock lock];
@ -785,13 +785,13 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
@end
@implementation NSArray (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
unsigned size = [super sizeInBytes: exclude];
NSUInteger size = [super sizeInBytes: exclude];
if (size > 0)
{
unsigned count = [self count];
NSUInteger count = [self count];
size += count*sizeof(void*);
while (count-- > 0)
@ -804,9 +804,9 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
@end
@implementation NSData (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
unsigned size = [super sizeInBytes: exclude];
NSUInteger size = [super sizeInBytes: exclude];
if (size > 0)
{
@ -817,13 +817,13 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
@end
@implementation NSDictionary (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
unsigned size = [super sizeInBytes: exclude];
NSUInteger size = [super sizeInBytes: exclude];
if (size > 0)
{
unsigned count = [self count];
NSUInteger count = [self count];
size += 3 * sizeof(void*) * count;
if (count > 0)
@ -846,7 +846,7 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
@end
@implementation NSObject (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
if ([exclude member: self] != nil)
{
@ -859,13 +859,13 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
@end
@implementation NSSet (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
unsigned size = [super sizeInBytes: exclude];
NSUInteger size = [super sizeInBytes: exclude];
if (size > 0)
{
unsigned count = [self count];
NSUInteger count = [self count];
size += 3 * sizeof(void*) * count;
if (count > 0)
@ -886,7 +886,7 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
@end
@implementation NSString (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
if ([exclude member: self] != nil)
{
@ -910,23 +910,23 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
* The actual memory usage will be larger than this of course.
*/
@implementation GSMimeDocument (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
return [[self rawMimeData] sizeInBytes: exclude];
}
@end
@implementation GSMimeHeader (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
return [[self rawMimeData] sizeInBytes: exclude];
}
@end
#else
@implementation GSMimeDocument (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
unsigned size = [super sizeInBytes: exclude];
NSUInteger size = [super sizeInBytes: exclude];
if (size > 0)
{
@ -937,9 +937,9 @@ static void removeItem(GSCacheItem *item, GSCacheItem **first)
@end
@implementation GSMimeHeader (GSCacheSizeInBytes)
- (unsigned) sizeInBytes: (NSMutableSet*)exclude
- (NSUInteger) sizeInBytes: (NSMutableSet*)exclude
{
unsigned size = [super sizeInBytes: exclude];
NSUInteger size = [super sizeInBytes: exclude];
if (size > 0)
{