From: <na...@us...> - 2010-09-17 07:34:53
|
Revision: 921 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=921&view=rev Author: nandod Date: 2010-09-17 07:34:46 +0000 (Fri, 17 Sep 2010) Log Message: ----------- * Fixed a few typos related to burst load mode. * Renamed IO_CIRCULAR_REFERENCE_CHECK to IO_NO_CIRCULAR_REFERENCE_CHECK and inverted the logic in the code. Required to allow applications to disable the check without keeping a different copy of InstantDefines.inc. Modified Paths: -------------- trunk/Source/Core/InstantPersistence.pas trunk/Source/InstantDefines.inc Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2010-09-17 07:20:12 UTC (rev 920) +++ trunk/Source/Core/InstantPersistence.pas 2010-09-17 07:34:46 UTC (rev 921) @@ -812,7 +812,7 @@ procedure DoStore(ConflictAction: TInstantConflictAction); procedure DoUnchange; function FindDefaultContainer: TInstantContainer; -{$IFDEF IO_CIRCULAR_REFERENCE_CHECK} +{$IFNDEF IO_NO_CIRCULAR_REFERENCE_CHECK} procedure FreeCircularReferences; {$ENDIF} function GetClassId: string; @@ -1148,7 +1148,6 @@ FMaxCount: Integer; FRequestedLoadMode: TInstantLoadMode; FActualLoadMode: TInstantLoadMode; - FLoadMode: TInstantLoadMode; function GetConnector: TInstantConnector; function GetObjectCount: Integer; function GetObjects(Index: Integer): TObject; @@ -1198,8 +1197,8 @@ property ObjectCount: Integer read GetObjectCount; property Objects[Index: Integer]: TObject read GetObjects; property Params: TParams read GetParams write SetParams; - property RequestedLoadMode: TInstantLoadMode read FLoadMode write FLoadMode - default lmKeysFirst; + property RequestedLoadMode: TInstantLoadMode + read FRequestedLoadMode write FRequestedLoadMode default lmKeysFirst; property ActualLoadMode: TInstantLoadMode read FActualLoadMode; end; @@ -6213,7 +6212,7 @@ DestroyInternalFields; end; -{$IFDEF IO_CIRCULAR_REFERENCE_CHECK} +{$IFNDEF IO_NO_CIRCULAR_REFERENCE_CHECK} procedure TInstantObject.FreeCircularReferences; var CheckedObjects: TObjectList; @@ -6295,7 +6294,7 @@ procedure TInstantObject.FreeInstance; begin -{$IFDEF IO_CIRCULAR_REFERENCE_CHECK} +{$IFNDEF IO_NO_CIRCULAR_REFERENCE_CHECK} FreeCircularReferences; {$ENDIF} DoRelease; @@ -6779,7 +6778,7 @@ if Assigned(Instance) then begin inherited FreeInstance; - Self := Instance as TInstantObject; + Self := Instance; AddRef; if ARefresh then Refresh; @@ -6948,7 +6947,7 @@ function TInstantObject._Release: Integer; begin -{$IFDEF IO_CIRCULAR_REFERENCE_CHECK} +{$IFNDEF IO_NO_CIRCULAR_REFERENCE_CHECK} FreeCircularReferences; {$ENDIF} Result := DoRelease; Modified: trunk/Source/InstantDefines.inc =================================================================== --- trunk/Source/InstantDefines.inc 2010-09-17 07:20:12 UTC (rev 920) +++ trunk/Source/InstantDefines.inc 2010-09-17 07:34:46 UTC (rev 921) @@ -195,18 +195,18 @@ are any objects that circularly refer to it, which should be destroyed as well. If you are sure that your object model doesn't allow circular references (as is the case with many object models, especially simple ones), - you can undefine this symbol to gain a little speed in programs that create + you can define this symbol to gain a little speed in programs that create and destroy large quantities of objects. WARNING: If you disable the check, then every time your program frees an object with circular references, it will leak memory. You might not notice it - unless you are using memory leak detection tools such as FastMM. + unless you are using a memory leak detection tool such as FastMM. So please make sure your model doesn't allow any circular reference - before turning this setting off. + before enabling this define. - Also, do it only if you actually need the speed gain, which is needed only - in special cases. + Also, do it only if you actually need the speed gain, which is not significant + in most cases. } -{$DEFINE IO_CIRCULAR_REFERENCE_CHECK} +{.$DEFINE IO_NO_CIRCULAR_REFERENCE_CHECK} |