aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2016-07-10 00:12:20 +0200
committerMax <post@wickenrode.com>2016-07-10 00:12:20 +0200
commit33f6a7afddd8e17edca1559c0aa120f30e216c2f (patch)
tree78072eed3a9c741358d2ef7ec68039874ffcbeea
parentbfc53dc39c04f4c2eb3d0d79a938cf5dea368da5 (diff)
downloadsequelpro-33f6a7afddd8e17edca1559c0aa120f30e216c2f.tar.gz
sequelpro-33f6a7afddd8e17edca1559c0aa120f30e216c2f.tar.bz2
sequelpro-33f6a7afddd8e17edca1559c0aa120f30e216c2f.zip
Remove debug code for #2163
Issue last seen with NB 4644 on 2016-01-21. Seems to be fixed.
-rw-r--r--Source/SPDataStorage.h3
-rw-r--r--Source/SPDataStorage.m54
2 files changed, 0 insertions, 57 deletions
diff --git a/Source/SPDataStorage.h b/Source/SPDataStorage.h
index d09eb696..bb45f71b 100644
--- a/Source/SPDataStorage.h
+++ b/Source/SPDataStorage.h
@@ -47,9 +47,6 @@
NSUInteger numberOfColumns;
NSUInteger editedRowCount;
-
- NSString *_debugInfo;
- uint64_t _debugTime;
}
/* Setting result store */
diff --git a/Source/SPDataStorage.m b/Source/SPDataStorage.m
index 46db243f..fca33c0a 100644
--- a/Source/SPDataStorage.m
+++ b/Source/SPDataStorage.m
@@ -37,13 +37,9 @@
@interface SPDataStorage (Private_API)
- (void) _checkNewRow:(NSMutableArray *)aRow;
-- (void)_recordClearingUnloadedColumnsAt:(uint64_t)now from:(NSArray *)callStack;
-- (void)_assesUnloadedColumnsIsSet;
@end
-static uint64_t _elapsedMilliSecondsSinceAbsoluteTime(uint64_t comparisonTime);
-
@implementation SPDataStorage
static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore, NSUInteger rowIndex)
@@ -129,7 +125,6 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
NSMutableArray *dataArray = SPMySQLResultStoreGetRow(dataStorage, anIndex);
// Modify unloaded cells as appropriate
- [self _assesUnloadedColumnsIsSet];
for (NSUInteger i = 0; i < numberOfColumns; i++) {
if (unloadedColumns[i]) {
CFArraySetValueAtIndex((CFMutableArrayRef)dataArray, i, notLoaded);
@@ -162,7 +157,6 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
}
// If the specified column is not loaded, return a SPNotLoaded reference
- [self _assesUnloadedColumnsIsSet];
if (unloadedColumns[columnIndex]) {
return notLoaded;
}
@@ -199,7 +193,6 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
}
// If the specified column is not loaded, return a SPNotLoaded reference
- [self _assesUnloadedColumnsIsSet];
if (unloadedColumns[columnIndex]) {
return notLoaded;
}
@@ -229,8 +222,6 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
[NSException raise:NSRangeException format:@"Requested storage column (col %llu) beyond bounds (%llu)", (unsigned long long)columnIndex, (unsigned long long)numberOfColumns];
}
-
- [self _assesUnloadedColumnsIsSet];
if (unloadedColumns[columnIndex]) {
return YES;
}
@@ -268,7 +259,6 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
targetRow = SPMySQLResultStoreGetRow(dataStorage, state->state);
// Modify unloaded cells as appropriate
- [self _assesUnloadedColumnsIsSet];
for (NSUInteger i = 0; i < numberOfColumns; i++) {
if (unloadedColumns[i]) {
CFArraySetValueAtIndex((CFMutableArrayRef)targetRow, i, notLoaded);
@@ -442,7 +432,6 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
if (columnIndex >= numberOfColumns) {
[NSException raise:NSRangeException format:@"Invalid column set as unloaded; requested column index (%llu) beyond bounds (%llu)", (unsigned long long)columnIndex, (unsigned long long)numberOfColumns];
}
- [self _assesUnloadedColumnsIsSet];
unloadedColumns[columnIndex] = YES;
}
}
@@ -506,9 +495,6 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
numberOfColumns = 0;
editedRowCount = 0;
-
- _debugInfo = nil;
- _debugTime = mach_absolute_time();
}
return self;
}
@@ -519,16 +505,9 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
SPClear(dataStorage);
SPClear(editedRows);
if (unloadedColumns) {
- [self _recordClearingUnloadedColumnsAt:mach_absolute_time() from:[NSThread callStackSymbols]];
free(unloadedColumns), unloadedColumns = NULL;
}
}
- // this is very very unlikely, but if another thread had been waiting on the lock
- // right before we free'd unloadedColumns, it should get it before we can release
- // _debugInfo, too.
- @synchronized(self) {
- SPClear(_debugInfo);
- }
[super dealloc];
}
@@ -545,37 +524,4 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore
}
}
-// DO NOT CALL THIS METHOD UNLESS YOU CURRENTLY HAVE A LOCK ON SELF!!!
-- (void)_recordClearingUnloadedColumnsAt:(uint64_t)now from:(NSArray *)callStack
-{
- _debugTime = now;
- SPClear(_debugInfo);
- _debugInfo = [[NSString alloc] initWithFormat:@"Thread: %@, Stack: %@",[NSThread currentThread],callStack];
-}
-
-// DO NOT CALL THIS METHOD UNLESS YOU CURRENTLY HAVE A LOCK ON SELF!!!
-- (void)_assesUnloadedColumnsIsSet
-{
- if(unloadedColumns != NULL)
- return;
-
- uint64_t timeDiff = _elapsedMilliSecondsSinceAbsoluteTime(_debugTime);
-
- NSString *msg;
- if(!_debugInfo)
- msg = [NSString stringWithFormat:@"unloadedColumns is not set and never has been since the object was created %llums ago.",timeDiff];
- else
- msg = [NSString stringWithFormat:@"unloadedColumns was last cleared %llums ago at %@",timeDiff,_debugInfo];
-
- @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:msg userInfo:nil];
-}
-
@end
-
-static uint64_t _elapsedMilliSecondsSinceAbsoluteTime(uint64_t comparisonTime)
-{
- uint64_t elapsedTime_t = mach_absolute_time() - comparisonTime;
- Nanoseconds elapsedTime = AbsoluteToNanoseconds(*(AbsoluteTime *)&(elapsedTime_t));
-
- return (UnsignedWideToUInt64(elapsedTime) / 1000000ULL);
-}