mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +00:00
(DeallocationHelpers): New category containing _empty and
_collectionDeallocate. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@188 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4e2f5f4645
commit
24ff419bff
2 changed files with 26 additions and 2 deletions
|
@ -42,6 +42,18 @@
|
|||
- (void) _decodeContentsWithCoder: (Coder*)aCoder;
|
||||
@end
|
||||
|
||||
@interface Collection (DeallocationHelpers)
|
||||
|
||||
/* Empty the internals of a collection after the contents have
|
||||
already been released. */
|
||||
- _empty;
|
||||
|
||||
/* Deallocate the internals of a collection after the contents
|
||||
have already been released. */
|
||||
- (void) _collectionDealloc;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/* To be used inside methods for getting the element comparison function.
|
||||
This macro could be redefined when the comparison function is an
|
||||
|
@ -74,7 +86,7 @@
|
|||
|
||||
/* Used inside a method for sending "-autorelease" if necessary */
|
||||
#define AUTORELEASE_ELT(ELT) \
|
||||
({if (CONTAINS_OBJECTS) ((elt)[ELT.id_u autorelease]) else ELT;})
|
||||
((CONTAINS_OBJECTS) ? ((elt)[ELT.id_u autorelease]) : ELT)
|
||||
|
||||
|
||||
/* Error Handling */
|
||||
|
|
|
@ -42,6 +42,18 @@
|
|||
- (void) _decodeContentsWithCoder: (Coder*)aCoder;
|
||||
@end
|
||||
|
||||
@interface Collection (DeallocationHelpers)
|
||||
|
||||
/* Empty the internals of a collection after the contents have
|
||||
already been released. */
|
||||
- _empty;
|
||||
|
||||
/* Deallocate the internals of a collection after the contents
|
||||
have already been released. */
|
||||
- (void) _collectionDealloc;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/* To be used inside methods for getting the element comparison function.
|
||||
This macro could be redefined when the comparison function is an
|
||||
|
@ -74,7 +86,7 @@
|
|||
|
||||
/* Used inside a method for sending "-autorelease" if necessary */
|
||||
#define AUTORELEASE_ELT(ELT) \
|
||||
({if (CONTAINS_OBJECTS) ((elt)[ELT.id_u autorelease]) else ELT;})
|
||||
((CONTAINS_OBJECTS) ? ((elt)[ELT.id_u autorelease]) : ELT)
|
||||
|
||||
|
||||
/* Error Handling */
|
||||
|
|
Loading…
Reference in a new issue