Index: src/OFASN1BitString.h ================================================================== --- src/OFASN1BitString.h +++ src/OFASN1BitString.h @@ -24,10 +24,11 @@ @class OFData; /*! * @brief An ASN.1 BitString. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1BitString: OFObject { OFData *_bitStringValue; size_t _bitStringLength; } Index: src/OFASN1Boolean.h ================================================================== --- src/OFASN1Boolean.h +++ src/OFASN1Boolean.h @@ -22,10 +22,11 @@ OF_ASSUME_NONNULL_BEGIN /*! * @brief An ASN.1 Boolean. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1Boolean: OFObject { bool _booleanValue; } Index: src/OFASN1Enumerated.h ================================================================== --- src/OFASN1Enumerated.h +++ src/OFASN1Enumerated.h @@ -21,10 +21,11 @@ OF_ASSUME_NONNULL_BEGIN /*! * @brief An ASN.1 Enumerated. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1Enumerated: OFObject { intmax_t _integerValue; } Index: src/OFASN1IA5String.h ================================================================== --- src/OFASN1IA5String.h +++ src/OFASN1IA5String.h @@ -23,10 +23,11 @@ @class OFString; /*! * @brief An ASN.1 IA5String. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1IA5String: OFObject { OFString *_IA5StringValue; } Index: src/OFASN1Integer.h ================================================================== --- src/OFASN1Integer.h +++ src/OFASN1Integer.h @@ -21,10 +21,11 @@ OF_ASSUME_NONNULL_BEGIN /*! * @brief An ASN.1 Integer. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1Integer: OFObject { intmax_t _integerValue; } Index: src/OFASN1NumericString.h ================================================================== --- src/OFASN1NumericString.h +++ src/OFASN1NumericString.h @@ -23,10 +23,11 @@ @class OFString; /*! * @brief An ASN.1 NumericString. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1NumericString: OFObject { OFString *_numericStringValue; } Index: src/OFASN1ObjectIdentifier.h ================================================================== --- src/OFASN1ObjectIdentifier.h +++ src/OFASN1ObjectIdentifier.h @@ -24,10 +24,11 @@ @class OFNumber; /*! * @brief An ASN.1 ObjectIdentifier. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1ObjectIdentifier: OFObject { OFArray OF_GENERIC(OFNumber *) *_subidentifiers; } Index: src/OFASN1OctetString.h ================================================================== --- src/OFASN1OctetString.h +++ src/OFASN1OctetString.h @@ -23,10 +23,11 @@ @class OFData; /*! * @brief An ASN.1 OctetString. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1OctetString: OFObject { OFData *_octetStringValue; } Index: src/OFASN1PrintableString.h ================================================================== --- src/OFASN1PrintableString.h +++ src/OFASN1PrintableString.h @@ -23,10 +23,11 @@ @class OFString; /*! * @brief An ASN.1 PrintableString. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1PrintableString: OFObject { OFString *_printableStringValue; } Index: src/OFASN1UTF8String.h ================================================================== --- src/OFASN1UTF8String.h +++ src/OFASN1UTF8String.h @@ -23,10 +23,11 @@ @class OFString; /*! * @brief An ASN.1 UTF8String. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1UTF8String: OFObject { OFString *_UTF8StringValue; } Index: src/OFASN1Value.h ================================================================== --- src/OFASN1Value.h +++ src/OFASN1Value.h @@ -70,10 +70,11 @@ } of_asn1_tag_number_t; /*! * @brief A class representing an ASN.1 value. */ +OF_SUBCLASSING_RESTRICTED @interface OFASN1Value: OFObject { of_asn1_tag_class_t _tagClass; of_asn1_tag_number_t _tagNumber; bool _constructed; Index: src/OFAdjacentArray.h ================================================================== --- src/OFAdjacentArray.h +++ src/OFAdjacentArray.h @@ -19,12 +19,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFMutableData; +OF_SUBCLASSING_RESTRICTED @interface OFAdjacentArray: OFArray { OFMutableData *_array; } @end OF_ASSUME_NONNULL_END Index: src/OFAdjacentSubarray.h ================================================================== --- src/OFAdjacentSubarray.h +++ src/OFAdjacentSubarray.h @@ -17,9 +17,10 @@ #import "OFSubarray.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFAdjacentSubarray: OFSubarray @end OF_ASSUME_NONNULL_END Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -120,10 +120,11 @@ * * In order to create a new OFApplication, you should create a class conforming * to the optional @ref OFApplicationDelegate protocol and put * `OF_APPLICATION_DELEGATE(NameOfYourClass)` in the .m file of that class. */ +OF_SUBCLASSING_RESTRICTED @interface OFApplication: OFObject { OFString *_programName; OFArray OF_GENERIC(OFString *) *_arguments; OFMutableDictionary OF_GENERIC(OFString *, OFString *) *_environment; Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -90,10 +90,14 @@ * @note Subclasses must implement @ref count and @ref objectAtIndex:. */ @interface OFArray OF_GENERIC(ObjectType): OFObject +{ + OF_RESERVE_IVARS(4) +} + #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif /*! * @brief The objects of the array as a C array. Index: src/OFBitSetCharacterSet.h ================================================================== --- src/OFBitSetCharacterSet.h +++ src/OFBitSetCharacterSet.h @@ -17,13 +17,14 @@ #import "OFCharacterSet.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFBitSetCharacterSet: OFCharacterSet { unsigned char *_bitset; size_t _size; } @end OF_ASSUME_NONNULL_END Index: src/OFBlock.h ================================================================== --- src/OFBlock.h +++ src/OFBlock.h @@ -29,15 +29,18 @@ @interface OFBlock: OFObject + (instancetype)alloc OF_UNAVAILABLE; - (instancetype)init OF_UNAVAILABLE; @end +OF_SUBCLASSING_RESTRICTED @interface OFStackBlock: OFBlock @end +OF_SUBCLASSING_RESTRICTED @interface OFGlobalBlock: OFBlock @end +OF_SUBCLASSING_RESTRICTED @interface OFMallocBlock: OFBlock @end OF_ASSUME_NONNULL_END Index: src/OFBytesValue.h ================================================================== --- src/OFBytesValue.h +++ src/OFBytesValue.h @@ -17,14 +17,15 @@ #import "OFValue.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFBytesValue: OFValue { size_t _size; void *_bytes; const char *_objCType; } @end OF_ASSUME_NONNULL_END Index: src/OFCharacterSet.h ================================================================== --- src/OFCharacterSet.h +++ src/OFCharacterSet.h @@ -26,10 +26,14 @@ * @brief A class cluster representing a character set. * * @note Subclasses must implement @ref characterIsMember:. */ @interface OFCharacterSet: OFObject +{ + OF_RESERVE_IVARS(4) +} + #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, readonly, nonatomic) OFCharacterSet *whitespaceCharacterSet; #endif /*! Index: src/OFColor.h ================================================================== --- src/OFColor.h +++ src/OFColor.h @@ -25,10 +25,11 @@ * @brief A class for storing a color. */ @interface OFColor: OFObject { float _red, _green, _blue, _alpha; + OF_RESERVE_IVARS(4) } /*! * @brief Creates a new color with the specified red, green, blue and alpha * value. Index: src/OFCondition.h ================================================================== --- src/OFCondition.h +++ src/OFCondition.h @@ -26,10 +26,11 @@ /*! * @class OFCondition OFCondition.h ObjFW/OFCondition.h * * @brief A class implementing a condition variable for thread synchronization. */ +OF_SUBCLASSING_RESTRICTED @interface OFCondition: OFMutex { of_condition_t _condition; bool _conditionInitialized; } Index: src/OFConstantString.h ================================================================== --- src/OFConstantString.h +++ src/OFConstantString.h @@ -33,13 +33,14 @@ /*! * @class OFConstantString OFConstantString.h ObjFW/OFConstantString.h * * @brief A class for storing constant strings using the `@""` literal. */ +OF_SUBCLASSING_RESTRICTED @interface OFConstantString: OFString { char *_cString; unsigned int _cStringLength; } @end OF_ASSUME_NONNULL_END Index: src/OFCountedMapTableSet.h ================================================================== --- src/OFCountedMapTableSet.h +++ src/OFCountedMapTableSet.h @@ -19,12 +19,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFMapTable; +OF_SUBCLASSING_RESTRICTED @interface OFCountedMapTableSet: OFCountedSet { OFMapTable *_mapTable; } @end OF_ASSUME_NONNULL_END Index: src/OFCountedSet.h ================================================================== --- src/OFCountedSet.h +++ src/OFCountedSet.h @@ -46,10 +46,14 @@ @interface OFCountedSet OF_GENERIC(ObjectType): OFMutableSet OF_GENERIC(ObjectType) #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief Returns how often the object is in the set. * * @return How often the object is in the set */ Index: src/OFDNSResolver.h ================================================================== --- src/OFDNSResolver.h +++ src/OFDNSResolver.h @@ -119,10 +119,11 @@ * @note If you change any of the properties, make sure to set * @ref configReloadInterval to 0, as otherwise your changes will be * reverted back to the system configuration on the next periodic config * reload. */ +OF_SUBCLASSING_RESTRICTED @interface OFDNSResolver: OFObject { OFDictionary OF_GENERIC(OFString *, OFArray OF_GENERIC(OFString *) *) *_staticHosts; OFArray OF_GENERIC(OFString *) *_nameServers; Index: src/OFDNSResourceRecord.h ================================================================== --- src/OFDNSResourceRecord.h +++ src/OFDNSResourceRecord.h @@ -75,10 +75,11 @@ { OFString *_name; of_dns_resource_record_class_t _recordClass; of_dns_resource_record_type_t _recordType; uint32_t _TTL; + OF_RESERVE_IVARS(4) } /** * @brief The domain name to which the resource record belongs. */ @@ -119,10 +120,11 @@ /*! * @class OFADNSResourceRecord OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing an A DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFADNSResourceRecord: OFDNSResourceRecord { of_socket_address_t _address; } @@ -154,10 +156,11 @@ * @class OFAAAADNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class represenging a DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFAAAADNSResourceRecord: OFDNSResourceRecord { of_socket_address_t _address; } @@ -189,10 +192,11 @@ * @class OFCNAMEDNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing a CNAME DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFCNAMEDNSResourceRecord: OFDNSResourceRecord { OFString *_alias; } @@ -226,10 +230,11 @@ * @class OFHINFODNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing an HINFO DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFHINFODNSResourceRecord: OFDNSResourceRecord { OFString *_CPU, *_OS; } @@ -270,10 +275,11 @@ * @class OFMXDNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing an MX DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFMXDNSResourceRecord: OFDNSResourceRecord { uint16_t _preference; OFString *_mailExchange; } @@ -315,10 +321,11 @@ * @class OFNSDNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing an NS DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFNSDNSResourceRecord: OFDNSResourceRecord { OFString *_authoritativeHost; } @@ -352,10 +359,11 @@ * @class OFPTRDNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing a PTR DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFPTRDNSResourceRecord: OFDNSResourceRecord { OFString *_domainName; } @@ -389,10 +397,11 @@ * @class OFRPNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing an RP DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFRPDNSResourceRecord: OFDNSResourceRecord { OFString *_mailbox, *_TXTDomainName; } @@ -435,10 +444,11 @@ * @class OFSOADNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing an SOA DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFSOADNSResourceRecord: OFDNSResourceRecord { OFString *_primaryNameServer, *_responsiblePerson; uint32_t _serialNumber, _refreshInterval, _retryInterval; uint32_t _expirationInterval, _minTTL; @@ -516,10 +526,11 @@ * @class OFSRVDNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing an SRV DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFSRVDNSResourceRecord: OFDNSResourceRecord { uint16_t _priority, _weight; OFString *_target; uint16_t _port; @@ -574,10 +585,11 @@ * @class OFTXTDNSResourceRecord \ * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing a TXT DNS resource record. */ +OF_SUBCLASSING_RESTRICTED @interface OFTXTDNSResourceRecord: OFDNSResourceRecord { OFData *_textData; } Index: src/OFData.h ================================================================== --- src/OFData.h +++ src/OFData.h @@ -41,10 +41,11 @@ { unsigned char *_items; size_t _count, _itemSize; bool _freeWhenDone; OFData *_parentData; + OF_RESERVE_IVARS(4) } /*! * @brief The size of a single item in the OFData in bytes. */ Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -27,10 +27,11 @@ /*! * @class OFDate OFDate.h ObjFW/OFDate.h * * @brief A class for storing, accessing and comparing dates. */ +OF_SUBCLASSING_RESTRICTED @interface OFDate: OFObject { of_time_interval_t _seconds; } Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -60,10 +60,14 @@ OFMessagePackRepresentation> #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define KeyType id # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief An array of all keys. */ @property (readonly, nonatomic) OFArray OF_GENERIC(KeyType) *allKeys; Index: src/OFDimensionValue.h ================================================================== --- src/OFDimensionValue.h +++ src/OFDimensionValue.h @@ -17,12 +17,13 @@ #import "OFValue.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFDimensionValue: OFValue { of_dimension_t _dimension; } @end OF_ASSUME_NONNULL_END Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -94,10 +94,14 @@ */ @interface OFEnumerator OF_GENERIC(ObjectType): OFObject #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief Returns the next object or `nil` if there is none left. * * @return The next object or `nil` if there is none left */ Index: src/OFEpollKernelEventObserver.h ================================================================== --- src/OFEpollKernelEventObserver.h +++ src/OFEpollKernelEventObserver.h @@ -19,13 +19,14 @@ OF_ASSUME_NONNULL_BEGIN @class OFMapTable; +OF_SUBCLASSING_RESTRICTED @interface OFEpollKernelEventObserver: OFKernelEventObserver { int _epfd; OFMapTable *_FDToEvents; } @end OF_ASSUME_NONNULL_END Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -34,10 +34,11 @@ /*! * @class OFFile OFFile.h ObjFW/OFFile.h * * @brief A class which provides methods to read and write files. */ +OF_SUBCLASSING_RESTRICTED @interface OFFile: OFSeekableStream #ifdef OF_FILE_HANDLE_IS_FD #endif { Index: src/OFFileManager.h ================================================================== --- src/OFFileManager.h +++ src/OFFileManager.h @@ -240,10 +240,13 @@ * @class OFFileManager OFFileManager.h ObjFW/OFFileManager.h * * @brief A class which provides management for files, e.g. reading contents of * directories, deleting files, renaming files, etc. */ +#ifndef OF_FILE_MANAGER_M +OF_SUBCLASSING_RESTRICTED +#endif @interface OFFileManager: OFObject #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, readonly, nonatomic) OFFileManager *defaultManager; #endif Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -14,10 +14,12 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#define OF_FILE_MANAGER_M #include #include #include "unistd_wrapper.h" Index: src/OFFileURLHandler.h ================================================================== --- src/OFFileURLHandler.h +++ src/OFFileURLHandler.h @@ -17,10 +17,11 @@ #import "OFURLHandler.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFFileURLHandler: OFURLHandler + (bool)of_directoryExistsAtPath: (OFString *)path; @end OF_ASSUME_NONNULL_END Index: src/OFGZIPStream.h ================================================================== --- src/OFGZIPStream.h +++ src/OFGZIPStream.h @@ -26,10 +26,11 @@ * @class OFGZIPStream OFGZIPStream.h ObjFW/OFGZIPStream.h * * @brief A class that handles GZIP compression and decompression transparently * for an underlying stream. */ +OF_SUBCLASSING_RESTRICTED @interface OFGZIPStream: OFStream { OFStream *_stream; OFInflateStream *_Nullable _inflateStream; enum of_gzip_stream_state { Index: src/OFHMAC.h ================================================================== --- src/OFHMAC.h +++ src/OFHMAC.h @@ -23,10 +23,11 @@ /*! * @class OFHMAC OFHMAC.h ObjFW/OFHMAC.h * * @brief A class which provides methods to calculate an HMAC. */ +OF_SUBCLASSING_RESTRICTED @interface OFHMAC: OFObject { Class _hashClass; id _Nullable _outerHash, _innerHash; id _Nullable _outerHashCopy, _innerHashCopy; Index: src/OFHTTPClient.h ================================================================== --- src/OFHTTPClient.h +++ src/OFHTTPClient.h @@ -138,10 +138,11 @@ /*! * @class OFHTTPClient OFHTTPClient.h ObjFW/OFHTTPClient.h * * @brief A class for performing HTTP requests. */ +OF_SUBCLASSING_RESTRICTED @interface OFHTTPClient: OFObject { #ifdef OF_HTTPCLIENT_M @public #endif Index: src/OFHTTPCookie.h ================================================================== --- src/OFHTTPCookie.h +++ src/OFHTTPCookie.h @@ -35,10 +35,11 @@ { OFString *_name, *_value, *_domain, *_path; OFDate *_Nullable _expires; bool _secure, _HTTPOnly; OFMutableArray OF_GENERIC(OFString *) *_extensions; + OF_RESERVE_IVARS(4) } /*! * @brief The name of the cookie. */ Index: src/OFHTTPCookieManager.h ================================================================== --- src/OFHTTPCookieManager.h +++ src/OFHTTPCookieManager.h @@ -27,10 +27,11 @@ /*! * @class OFHTTPCookieManager OFHTTPCookieManager.h ObjFW/OFHTTPCookieManager.h * * @brief A class for managing cookies for multiple domains. */ +OF_SUBCLASSING_RESTRICTED @interface OFHTTPCookieManager: OFObject { OFMutableArray OF_GENERIC(OFHTTPCookie *) *_cookies; } Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -74,10 +74,11 @@ OFURL *_URL; of_http_request_method_t _method; of_http_request_protocol_version_t _protocolVersion; OFDictionary OF_GENERIC(OFString *, OFString *) *_Nullable _headers; of_socket_address_t _remoteAddress; + OF_RESERVE_IVARS(4) } /*! * @brief The URL of the HTTP request. */ Index: src/OFHTTPResponse.h ================================================================== --- src/OFHTTPResponse.h +++ src/OFHTTPResponse.h @@ -31,10 +31,11 @@ @interface OFHTTPResponse: OFStream { of_http_request_protocol_version_t _protocolVersion; short _statusCode; OFDictionary OF_GENERIC(OFString *, OFString *) *_headers; + OF_RESERVE_IVARS(4) } /*! * @brief The protocol version of the HTTP request reply. */ Index: src/OFHTTPServer.h ================================================================== --- src/OFHTTPServer.h +++ src/OFHTTPServer.h @@ -88,10 +88,11 @@ /*! * @class OFHTTPServer OFHTTPServer.h ObjFW/OFHTTPServer.h * * @brief A class for creating a simple HTTP server inside of applications. */ +OF_SUBCLASSING_RESTRICTED @interface OFHTTPServer: OFObject { OFString *_Nullable _host; uint16_t _port; bool _usesTLS; Index: src/OFHTTPURLHandler.h ================================================================== --- src/OFHTTPURLHandler.h +++ src/OFHTTPURLHandler.h @@ -17,9 +17,10 @@ #import "OFURLHandler.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFHTTPURLHandler: OFURLHandler @end OF_ASSUME_NONNULL_END Index: src/OFINICategory.h ================================================================== --- src/OFINICategory.h +++ src/OFINICategory.h @@ -26,10 +26,11 @@ /*! * @class OFINICategory OFINICategory.h ObjFW/OFINICategory.h * * @brief A class for representing a category of an INI file. */ +OF_SUBCLASSING_RESTRICTED @interface OFINICategory: OFObject { OFString *_name; OFMutableArray *_lines; } Index: src/OFINIFile.h ================================================================== --- src/OFINIFile.h +++ src/OFINIFile.h @@ -26,10 +26,11 @@ /*! * @class OFINIFile OFINIFile.h ObjFW/OFINIFile.h * * @brief A class for reading, creating and modifying INI files. */ +OF_SUBCLASSING_RESTRICTED @interface OFINIFile: OFObject { OFMutableArray OF_GENERIC(OFINICategory *) *_categories; } Index: src/OFINIFileSettings.h ================================================================== --- src/OFINIFileSettings.h +++ src/OFINIFileSettings.h @@ -20,13 +20,14 @@ OF_ASSUME_NONNULL_BEGIN @class OFString; @class OFINIFile; +OF_SUBCLASSING_RESTRICTED @interface OFINIFileSettings: OFSettings { OFString *_filePath; OFINIFile *_INIFile; } @end OF_ASSUME_NONNULL_END Index: src/OFInflate64Stream.h ================================================================== --- src/OFInflate64Stream.h +++ src/OFInflate64Stream.h @@ -29,10 +29,11 @@ * underlying stream does so, too. * * @brief A class that handles Deflate decompression transparently for an * underlying stream. */ +OF_SUBCLASSING_RESTRICTED @interface OFInflate64Stream: OFStream { #ifdef OF_INFLATE64_STREAM_M @public #endif Index: src/OFInflateStream.h ================================================================== --- src/OFInflateStream.h +++ src/OFInflateStream.h @@ -29,10 +29,11 @@ * underlying stream does so, too. * * @brief A class that handles Deflate decompression transparently for an * underlying stream. */ +OF_SUBCLASSING_RESTRICTED @interface OFInflateStream: OFStream { #ifdef OF_INFLATE_STREAM_M @public #endif Index: src/OFIntrospection.h ================================================================== --- src/OFIntrospection.h +++ src/OFIntrospection.h @@ -44,10 +44,11 @@ @interface OFMethod: OFObject { SEL _selector; OFString *_name; const char *_typeEncoding; + OF_RESERVE_IVARS(4) } /*! * @brief The selector of the method. */ @@ -74,10 +75,11 @@ @interface OFProperty: OFObject { OFString *_name; unsigned int _attributes; OFString *_Nullable _getter, *_Nullable _setter, *_Nullable _iVar; + OF_RESERVE_IVARS(4) } /*! * @brief The name of the property. */ @@ -128,10 +130,11 @@ @interface OFInstanceVariable: OFObject { OFString *_name; const char *_typeEncoding; ptrdiff_t _offset; + OF_RESERVE_IVARS(4) } /*! * @brief The name of the instance variable. */ @@ -153,10 +156,11 @@ /*! * @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h * * @brief A class for introspecting classes. */ +OF_SUBCLASSING_RESTRICTED @interface OFIntrospection: OFObject { OFMutableArray OF_GENERIC(OFMethod *) *_classMethods; OFMutableArray OF_GENERIC(OFMethod *) *_instanceMethods; OFMutableArray OF_GENERIC(OFProperty *) *_properties; Index: src/OFInvertedCharacterSet.h ================================================================== --- src/OFInvertedCharacterSet.h +++ src/OFInvertedCharacterSet.h @@ -17,10 +17,11 @@ #import "OFCharacterSet.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFInvertedCharacterSet: OFCharacterSet { OFCharacterSet *_characterSet; bool (*_characterIsMember)(id, SEL, of_unichar_t); } Index: src/OFInvocation.h ================================================================== --- src/OFInvocation.h +++ src/OFInvocation.h @@ -43,10 +43,11 @@ @interface OFInvocation: OFObject { OFMethodSignature *_methodSignature; OFMutableArray OF_GENERIC(OFMutableData *) *_arguments; OFMutableData *_returnValue; + OF_RESERVE_IVARS(4) } /*! * @brief The method signature for the invocation. */ Index: src/OFKernelEventObserver.h ================================================================== --- src/OFKernelEventObserver.h +++ src/OFKernelEventObserver.h @@ -139,10 +139,11 @@ OFMutableData *_queueActions; OFMutableArray *_queueObjects; #ifdef OF_AMIGAOS ULONG _execSignalMask; #endif + OF_RESERVE_IVARS(4) } /*! * @brief The delegate for the OFKernelEventObserver. */ Index: src/OFKqueueKernelEventObserver.h ================================================================== --- src/OFKqueueKernelEventObserver.h +++ src/OFKqueueKernelEventObserver.h @@ -19,12 +19,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFMutableArray OF_GENERIC(ObjectType); +OF_SUBCLASSING_RESTRICTED @interface OFKqueueKernelEventObserver: OFKernelEventObserver { int _kernelQueue; } @end OF_ASSUME_NONNULL_END Index: src/OFLHAArchive.h ================================================================== --- src/OFLHAArchive.h +++ src/OFLHAArchive.h @@ -27,10 +27,11 @@ /*! * @class OFLHAArchive OFLHAArchive.h ObjFW/OFLHAArchive.h * * @brief A class for accessing and manipulating LHA files. */ +OF_SUBCLASSING_RESTRICTED @interface OFLHAArchive: OFObject { OFStream *_stream; enum { OF_LHA_ARCHIVE_MODE_READ, Index: src/OFLHAArchiveEntry.h ================================================================== --- src/OFLHAArchiveEntry.h +++ src/OFLHAArchiveEntry.h @@ -45,10 +45,11 @@ OFString *_Nullable _fileComment; OFNumber *_Nullable _mode, *_Nullable _UID, *_Nullable _GID; OFString *_Nullable _owner, *_Nullable _group; OFDate *_Nullable _modificationDate; OFMutableArray OF_GENERIC(OFData *) *_extensions; + OF_RESERVE_IVARS(4) } /*! * @brief The file name of the entry. */ Index: src/OFLHADecompressingStream.h ================================================================== --- src/OFLHADecompressingStream.h +++ src/OFLHADecompressingStream.h @@ -19,10 +19,11 @@ OF_ASSUME_NONNULL_BEGIN #define OF_LHA_DECOMPRESSING_STREAM_BUFFER_SIZE 4096 +OF_SUBCLASSING_RESTRICTED @interface OFLHADecompressingStream: OFStream { @public OFStream *_stream; uint8_t _distanceBits, _dictionaryBits; Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -53,10 +53,11 @@ { of_list_object_t *_Nullable _firstListObject; of_list_object_t *_Nullable _lastListObject; size_t _count; unsigned long _mutations; + OF_RESERVE_IVARS(4) } /*! * @brief The first list object of the list. */ Index: src/OFLocale.h ================================================================== --- src/OFLocale.h +++ src/OFLocale.h @@ -41,10 +41,11 @@ /*! * @class OFLocale OFLocale.h ObjFW/OFLocale.h * * @brief A class for querying the locale and retrieving localized strings. */ +OF_SUBCLASSING_RESTRICTED @interface OFLocale: OFObject { OFString *_Nullable _language, *_Nullable _territory; of_string_encoding_t _encoding; OFString *_decimalPoint; Index: src/OFMD5Hash.h ================================================================== --- src/OFMD5Hash.h +++ src/OFMD5Hash.h @@ -24,10 +24,11 @@ /*! * @class OFMD5Hash OFMD5Hash.h ObjFW/OFMD5Hash.h * * @brief A class which provides methods to create an MD5 hash. */ +OF_SUBCLASSING_RESTRICTED @interface OFMD5Hash: OFObject { OFSecureData *_iVarsData; struct of_md5_hash_ivars { uint32_t state[4]; Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -68,10 +68,11 @@ * @class OFMapTable OFMapTable.h ObjFW/OFMapTable.h * * @brief A class similar to OFDictionary, but providing more options how keys * and objects should be retained, released, compared and hashed. */ +OF_SUBCLASSING_RESTRICTED @interface OFMapTable: OFObject { of_map_table_functions_t _keyFunctions, _objectFunctions; struct of_map_table_bucket *_Nonnull *_Nullable _buckets; uint32_t _count, _capacity; Index: src/OFMapTableDictionary.h ================================================================== --- src/OFMapTableDictionary.h +++ src/OFMapTableDictionary.h @@ -20,14 +20,15 @@ OF_ASSUME_NONNULL_BEGIN @class OFMapTable; @class OFMapTableEnumerator; +OF_SUBCLASSING_RESTRICTED @interface OFMapTableDictionary: OFDictionary { OFMapTable *_mapTable; } - (instancetype)initWithCapacity: (size_t)capacity; @end OF_ASSUME_NONNULL_END Index: src/OFMapTableSet.h ================================================================== --- src/OFMapTableSet.h +++ src/OFMapTableSet.h @@ -19,14 +19,15 @@ OF_ASSUME_NONNULL_BEGIN @class OFMapTable; +OF_SUBCLASSING_RESTRICTED @interface OFMapTableSet: OFSet { OFMapTable *_mapTable; } - (instancetype)initWithCapacity: (size_t)capacity; @end OF_ASSUME_NONNULL_END Index: src/OFMessagePackExtension.h ================================================================== --- src/OFMessagePackExtension.h +++ src/OFMessagePackExtension.h @@ -31,10 +31,11 @@ @interface OFMessagePackExtension: OFObject { int8_t _type; OFData *_data; + OF_RESERVE_IVARS(4) } /*! * @brief The MessagePack extension type. */ Index: src/OFMethodSignature.h ================================================================== --- src/OFMethodSignature.h +++ src/OFMethodSignature.h @@ -28,10 +28,11 @@ */ @interface OFMethodSignature: OFObject { char *_types; OFMutableData *_typesPointers, *_offsets; + OF_RESERVE_IVARS(4) } /*! * @brief The number of arguments of the method. */ Index: src/OFMutableAdjacentArray.h ================================================================== --- src/OFMutableAdjacentArray.h +++ src/OFMutableAdjacentArray.h @@ -19,13 +19,14 @@ OF_ASSUME_NONNULL_BEGIN @class OFMutableData; +OF_SUBCLASSING_RESTRICTED @interface OFMutableAdjacentArray: OFMutableArray { OFMutableData *_array; unsigned long _mutations; } @end OF_ASSUME_NONNULL_END Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -44,10 +44,14 @@ */ @interface OFMutableArray OF_GENERIC(ObjectType): OFArray OF_GENERIC(ObjectType) #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief Creates a new OFMutableArray with enough memory to hold the specified * number of objects. * * @param capacity The initial capacity for the OFMutableArray Index: src/OFMutableData.h ================================================================== --- src/OFMutableData.h +++ src/OFMutableData.h @@ -28,10 +28,11 @@ * @brief A class for storing and manipulating arbitrary data in an array. */ @interface OFMutableData: OFData { size_t _capacity; + OF_RESERVE_IVARS(4) } /*! * @brief All items of the OFMutableData as a C array. * Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -45,10 +45,14 @@ OFDictionary OF_GENERIC(KeyType, ObjectType) #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define KeyType id # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief Creates a new OFMutableDictionary with enough memory to hold the * specified number of objects. * * @param capacity The initial capacity for the OFMutableDictionary Index: src/OFMutableLHAArchiveEntry.h ================================================================== --- src/OFMutableLHAArchiveEntry.h +++ src/OFMutableLHAArchiveEntry.h @@ -24,10 +24,13 @@ * OFMutableLHAArchiveEntry.h ObjFW/OFMutableLHAArchiveEntry.h * * @brief A class which represents a mutable entry in an LHA archive. */ @interface OFMutableLHAArchiveEntry: OFLHAArchiveEntry +{ + OF_RESERVE_IVARS(4) +} /*! * @brief The file name of the entry. */ @property (readwrite, copy, nonatomic) OFString *fileName; Index: src/OFMutableMapTableDictionary.h ================================================================== --- src/OFMutableMapTableDictionary.h +++ src/OFMutableMapTableDictionary.h @@ -19,12 +19,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFMapTable; +OF_SUBCLASSING_RESTRICTED @interface OFMutableMapTableDictionary: OFMutableDictionary { OFMapTable *_mapTable; } @end OF_ASSUME_NONNULL_END Index: src/OFMutableMapTableSet.h ================================================================== --- src/OFMutableMapTableSet.h +++ src/OFMutableMapTableSet.h @@ -19,12 +19,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFMapTable; +OF_SUBCLASSING_RESTRICTED @interface OFMutableMapTableSet: OFMutableSet { OFMapTable *_mapTable; } @end OF_ASSUME_NONNULL_END Index: src/OFMutablePair.h ================================================================== --- src/OFMutablePair.h +++ src/OFMutablePair.h @@ -28,10 +28,14 @@ OFPair OF_GENERIC(FirstType, SecondType) #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define FirstType id # define SecondType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief The first object of the pair. */ @property (readwrite, nonatomic, retain) FirstType firstObject; Index: src/OFMutableSet.h ================================================================== --- src/OFMutableSet.h +++ src/OFMutableSet.h @@ -29,10 +29,14 @@ */ @interface OFMutableSet OF_GENERIC(ObjectType): OFSet OF_GENERIC(ObjectType) #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief Creates a new OFMutableSet with enough memory to hold the specified * number of objects. * * @param capacity The initial capacity for the OFMutableSet Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -23,10 +23,14 @@ * @class OFMutableString OFString.h ObjFW/OFString.h * * @brief A class for storing and modifying strings. */ @interface OFMutableString: OFString +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief Sets the character at the specified index. * * @param character The character to set * @param index The index where to set the character Index: src/OFMutableTarArchiveEntry.h ================================================================== --- src/OFMutableTarArchiveEntry.h +++ src/OFMutableTarArchiveEntry.h @@ -24,10 +24,13 @@ * OFMutableTarArchiveEntry.h ObjFW/OFMutableTarArchiveEntry.h * * @brief A class which represents a mutable entry of a tar archive. */ @interface OFMutableTarArchiveEntry: OFTarArchiveEntry +{ + OF_RESERVE_IVARS(4) +} /*! * @brief The file name of the entry. */ @property (readwrite, copy, nonatomic) OFString *fileName; Index: src/OFMutableTriple.h ================================================================== --- src/OFMutableTriple.h +++ src/OFMutableTriple.h @@ -29,10 +29,14 @@ #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define FirstType id # define SecondType id # define ThirdType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief The first object of the triple. */ @property (readwrite, nonatomic, retain) FirstType firstObject; Index: src/OFMutableURL.h ================================================================== --- src/OFMutableURL.h +++ src/OFMutableURL.h @@ -23,10 +23,14 @@ * @class OFMutableURL OFMutableURL.h ObjFW/OFMutableURL.h * * @brief A class for parsing URLs and accessing parts of it. */ @interface OFMutableURL: OFURL +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief The scheme part of the URL. */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *scheme; Index: src/OFMutableUTF8String.h ================================================================== --- src/OFMutableUTF8String.h +++ src/OFMutableUTF8String.h @@ -18,14 +18,15 @@ #import "OFMutableString.h" #import "OFUTF8String.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFMutableUTF8String: OFMutableString { @public struct of_string_utf8_ivars *restrict _s; struct of_string_utf8_ivars _storage; } @end OF_ASSUME_NONNULL_END Index: src/OFMutableZIPArchiveEntry.h ================================================================== --- src/OFMutableZIPArchiveEntry.h +++ src/OFMutableZIPArchiveEntry.h @@ -25,10 +25,13 @@ * * @brief A class which represents a mutable entry in the central directory of * a ZIP archive. */ @interface OFMutableZIPArchiveEntry: OFZIPArchiveEntry +{ + OF_RESERVE_IVARS(4) +} /*! * @brief The file name of the entry. */ @property (readwrite, copy, nonatomic) OFString *fileName; Index: src/OFMutex.h ================================================================== --- src/OFMutex.h +++ src/OFMutex.h @@ -30,10 +30,11 @@ @interface OFMutex: OFObject { of_mutex_t _mutex; bool _initialized; OFString *_Nullable _name; + OF_RESERVE_IVARS(4) } /*! * @brief Creates a new mutex. * Index: src/OFNonretainedObjectValue.h ================================================================== --- src/OFNonretainedObjectValue.h +++ src/OFNonretainedObjectValue.h @@ -17,12 +17,13 @@ #import "OFValue.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFNonretainedObjectValue: OFValue { id _object; } @end OF_ASSUME_NONNULL_END Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -114,10 +114,11 @@ /*! * @class OFNumber OFNumber.h ObjFW/OFNumber.h * * @brief Provides a way to store a number in an object. */ +OF_SUBCLASSING_RESTRICTED @interface OFNumber: OFValue { union of_number_value { bool bool_; Index: src/OFOptionsParser.h ================================================================== --- src/OFOptionsParser.h +++ src/OFOptionsParser.h @@ -64,10 +64,11 @@ /*! * @class OFOptionsParser OFOptionsParser.h ObjFW/OFOptionsParser.h * * @brief A class for parsing the program options specified on the command line. */ +OF_SUBCLASSING_RESTRICTED @interface OFOptionsParser: OFObject { of_options_parser_option_t *_options; OFMapTable *_longOptions; OFArray OF_GENERIC(OFString *) *_arguments; Index: src/OFPair.h ================================================================== --- src/OFPair.h +++ src/OFPair.h @@ -31,10 +31,11 @@ # define SecondType id #endif { FirstType _Nullable _firstObject; SecondType _Nullable _secondObject; + OF_RESERVE_IVARS(4) } /*! * @brief The first object of the pair. */ Index: src/OFPlugin.h ================================================================== --- src/OFPlugin.h +++ src/OFPlugin.h @@ -39,10 +39,11 @@ * @brief Provides a system for loading plugins at runtime. */ @interface OFPlugin: OFObject { of_plugin_handle_t _handle; + OF_RESERVE_IVARS(4) } /*! * @brief Loads a plugin from a file. * Index: src/OFPointValue.h ================================================================== --- src/OFPointValue.h +++ src/OFPointValue.h @@ -17,12 +17,13 @@ #import "OFValue.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFPointValue: OFValue { of_point_t _point; } @end OF_ASSUME_NONNULL_END Index: src/OFPointerValue.h ================================================================== --- src/OFPointerValue.h +++ src/OFPointerValue.h @@ -17,12 +17,13 @@ #import "OFValue.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFPointerValue: OFValue { void *_pointer; } @end OF_ASSUME_NONNULL_END Index: src/OFPollKernelEventObserver.h ================================================================== --- src/OFPollKernelEventObserver.h +++ src/OFPollKernelEventObserver.h @@ -19,14 +19,15 @@ OF_ASSUME_NONNULL_BEGIN @class OFMutableData; +OF_SUBCLASSING_RESTRICTED @interface OFPollKernelEventObserver: OFKernelEventObserver { OFMutableData *_FDs; int _maxFD; id __unsafe_unretained *_FDToObject; } @end OF_ASSUME_NONNULL_END Index: src/OFProcess.h ================================================================== --- src/OFProcess.h +++ src/OFProcess.h @@ -44,10 +44,11 @@ /*! * @class OFProcess OFProcess.h ObjFW/OFProcess.h * * @brief A class for stream-like communication with a newly created process. */ +OF_SUBCLASSING_RESTRICTED @interface OFProcess: OFStream #ifndef OF_WINDOWS #endif { Index: src/OFRIPEMD160Hash.h ================================================================== --- src/OFRIPEMD160Hash.h +++ src/OFRIPEMD160Hash.h @@ -24,10 +24,11 @@ /*! * @class OFRIPEMD160Hash OFRIPEMD160Hash.h ObjFW/OFRIPEMD160Hash.h * * @brief A class which provides methods to create a RIPEMD-160 hash. */ +OF_SUBCLASSING_RESTRICTED @interface OFRIPEMD160Hash: OFObject { OFSecureData *_iVarsData; struct of_ripemd160_hash_ivars { uint32_t state[5]; Index: src/OFRangeCharacterSet.h ================================================================== --- src/OFRangeCharacterSet.h +++ src/OFRangeCharacterSet.h @@ -17,12 +17,13 @@ #import "OFCharacterSet.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFRangeCharacterSet: OFCharacterSet { of_range_t _range; } @end OF_ASSUME_NONNULL_END Index: src/OFRangeValue.h ================================================================== --- src/OFRangeValue.h +++ src/OFRangeValue.h @@ -17,12 +17,13 @@ #import "OFValue.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFRangeValue: OFValue { of_range_t _range; } @end OF_ASSUME_NONNULL_END Index: src/OFRectangleValue.h ================================================================== --- src/OFRectangleValue.h +++ src/OFRectangleValue.h @@ -17,12 +17,13 @@ #import "OFValue.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFRectangleValue: OFValue { of_rectangle_t _rectangle; } @end OF_ASSUME_NONNULL_END Index: src/OFRecursiveMutex.h ================================================================== --- src/OFRecursiveMutex.h +++ src/OFRecursiveMutex.h @@ -26,10 +26,11 @@ * @class OFRecursiveMutex OFRecursiveMutex.h ObjFW/OFRecursiveMutex.h * * @brief A class for creating mutual exclusions which can be entered * recursively. */ +OF_SUBCLASSING_RESTRICTED @interface OFRecursiveMutex: OFObject { of_rmutex_t _rmutex; bool _initialized; OFString *_Nullable _name; Index: src/OFRunLoop.h ================================================================== --- src/OFRunLoop.h +++ src/OFRunLoop.h @@ -57,10 +57,11 @@ /*! * @class OFRunLoop OFRunLoop.h ObjFW/OFRunLoop.h * * @brief A class providing a run loop for the application and its processes. */ +OF_SUBCLASSING_RESTRICTED @interface OFRunLoop: OFObject { OFMutableDictionary *_states; #ifdef OF_HAVE_THREADS OFMutex *_statesMutex; Index: src/OFSHA1Hash.h ================================================================== --- src/OFSHA1Hash.h +++ src/OFSHA1Hash.h @@ -24,10 +24,11 @@ /*! * @class OFSHA1Hash OFSHA1Hash.h ObjFW/OFSHA1Hash.h * * @brief A class which provides methods to create an SHA-1 hash. */ +OF_SUBCLASSING_RESTRICTED @interface OFSHA1Hash: OFObject { OFSecureData *_iVarsData; struct of_sha1_hash_ivars { uint32_t state[5]; Index: src/OFSHA224Hash.h ================================================================== --- src/OFSHA224Hash.h +++ src/OFSHA224Hash.h @@ -22,9 +22,10 @@ /*! * @class OFSHA224Hash OFSHA224Hash.h ObjFW/OFSHA224Hash.h * * @brief A class which provides methods to create an SHA-224 hash. */ +OF_SUBCLASSING_RESTRICTED @interface OFSHA224Hash: OFSHA224Or256Hash @end OF_ASSUME_NONNULL_END Index: src/OFSHA224Or256Hash.h ================================================================== --- src/OFSHA224Or256Hash.h +++ src/OFSHA224Or256Hash.h @@ -37,9 +37,10 @@ uint32_t words[64]; } buffer; size_t bufferLength; } *_iVars; bool _calculated; + OF_RESERVE_IVARS(4) } @end OF_ASSUME_NONNULL_END Index: src/OFSHA256Hash.h ================================================================== --- src/OFSHA256Hash.h +++ src/OFSHA256Hash.h @@ -22,9 +22,10 @@ /*! * @class OFSHA256Hash OFSHA256Hash.h ObjFW/OFSHA256Hash.h * * @brief A class which provides methods to create an SHA-256 hash. */ +OF_SUBCLASSING_RESTRICTED @interface OFSHA256Hash: OFSHA224Or256Hash @end OF_ASSUME_NONNULL_END Index: src/OFSHA384Hash.h ================================================================== --- src/OFSHA384Hash.h +++ src/OFSHA384Hash.h @@ -22,9 +22,10 @@ /*! * @class OFSHA384Hash OFSHA384Hash.h ObjFW/OFSHA384Hash.h * * @brief A class which provides methods to create an SHA-384 hash. */ +OF_SUBCLASSING_RESTRICTED @interface OFSHA384Hash: OFSHA384Or512Hash @end OF_ASSUME_NONNULL_END Index: src/OFSHA384Or512Hash.h ================================================================== --- src/OFSHA384Or512Hash.h +++ src/OFSHA384Or512Hash.h @@ -37,9 +37,10 @@ uint64_t words[80]; } buffer; size_t bufferLength; } *_iVars; bool _calculated; + OF_RESERVE_IVARS(4) } @end OF_ASSUME_NONNULL_END Index: src/OFSHA512Hash.h ================================================================== --- src/OFSHA512Hash.h +++ src/OFSHA512Hash.h @@ -22,9 +22,10 @@ /*! * @class OFSHA512Hash OFSHA512Hash.h ObjFW/OFSHA512Hash.h * * @brief A class which provides methods to create an SHA-512 hash. */ +OF_SUBCLASSING_RESTRICTED @interface OFSHA512Hash: OFSHA384Or512Hash @end OF_ASSUME_NONNULL_END Index: src/OFSandbox.h ================================================================== --- src/OFSandbox.h +++ src/OFSandbox.h @@ -69,10 +69,11 @@ unsigned int _allowsUnveil: 1; unsigned int _returnsErrors: 1; OFMutableArray OF_GENERIC(of_sandbox_unveil_path_t) *_unveiledPaths; @public size_t _unveiledPathsIndex; + OF_RESERVE_IVARS(4) } /*! * @brief Allows IO operations on previously allocated file descriptors. */ Index: src/OFSecureData.h ================================================================== --- src/OFSecureData.h +++ src/OFSecureData.h @@ -26,10 +26,11 @@ * it when it gets deallocated. * * @note Secure memory might be unavailable on the platform, in which case this * falls back to insecure (potentially swappable) memory. */ +OF_SUBCLASSING_RESTRICTED @interface OFSecureData: OFData { struct page *_page; } Index: src/OFSeekableStream.h ================================================================== --- src/OFSeekableStream.h +++ src/OFSeekableStream.h @@ -54,10 +54,14 @@ * and makes it work together with the caching of OFStream. If you * override this methods without the `lowlevel` prefix, you *will* break * caching, get broken results and seek to the wrong position! */ @interface OFSeekableStream: OFStream +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief Seeks to the specified absolute offset. * * @param offset The offset in bytes * @param whence From where to seek.@n Index: src/OFSelectKernelEventObserver.h ================================================================== --- src/OFSelectKernelEventObserver.h +++ src/OFSelectKernelEventObserver.h @@ -30,13 +30,14 @@ #import "OFKernelEventObserver.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFSelectKernelEventObserver: OFKernelEventObserver { fd_set _readFDs, _writeFDs; int _maxFD; } @end OF_ASSUME_NONNULL_END Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -67,10 +67,14 @@ @interface OFSet OF_GENERIC(ObjectType): OFObject #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief An array of all objects in the set. */ @property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *allObjects; Index: src/OFSettings.h ================================================================== --- src/OFSettings.h +++ src/OFSettings.h @@ -34,10 +34,11 @@ * @brief A class for storing and retrieving settings */ @interface OFSettings: OFObject { OFString *_applicationName; + OF_RESERVE_IVARS(4) } /*! * @brief The name of the application whose settings are accessed by the * instance. Index: src/OFSortedList.h ================================================================== --- src/OFSortedList.h +++ src/OFSortedList.h @@ -29,10 +29,14 @@ */ @interface OFSortedList OF_GENERIC(ObjectType): OFList OF_GENERIC(ObjectType) #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif +{ + OF_RESERVE_IVARS(4) +} + - (of_list_object_t *)appendObject: (ObjectType)object OF_UNAVAILABLE; - (of_list_object_t *)prependObject: (ObjectType)object OF_UNAVAILABLE; - (of_list_object_t *)insertObject: (ObjectType)object beforeListObject: (of_list_object_t *)listObject OF_UNAVAILABLE; Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -204,10 +204,11 @@ size_t _readBufferLength, _writeBufferLength; bool _writeBuffered, _waitingForDelimiter; @protected bool _blocking; id _Nullable _delegate; + OF_RESERVE_IVARS(4) } /*! * @brief Whether the end of the stream has been reached. */ Index: src/OFStreamSocket.h ================================================================== --- src/OFStreamSocket.h +++ src/OFStreamSocket.h @@ -29,10 +29,11 @@ @interface OFStreamSocket: OFStream { of_socket_t _socket; bool _atEndOfStream; + OF_RESERVE_IVARS(4) } /*! * @brief Returns a new, autoreleased OFTCPSocket. * Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -119,10 +119,14 @@ * * @brief A class for handling strings. */ @interface OFString: OFObject +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief The length of the string in Unicode codepoints. */ @property (readonly, nonatomic) size_t length; Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -23,10 +23,11 @@ /*! * @class OFSystemInfo OFSystemInfo.h ObjFW/OFSystemInfo.h * * @brief A class for querying information about the system. */ +OF_SUBCLASSING_RESTRICTED @interface OFSystemInfo: OFObject #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, readonly, nonatomic) size_t pageSize; @property (class, readonly, nonatomic) size_t numberOfCPUs; @property (class, readonly, nonatomic) OFString *ObjFWVersion; Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -102,10 +102,11 @@ OFString *_Nullable _SOCKS5Host; uint16_t _SOCKS5Port; #ifdef OF_WII uint16_t _port; #endif + OF_RESERVE_IVARS(4) } #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, nullable, copy, nonatomic) OFString *SOCKS5Host; @property (class, nonatomic) uint16_t SOCKS5Port; Index: src/OFTarArchive.h ================================================================== --- src/OFTarArchive.h +++ src/OFTarArchive.h @@ -27,10 +27,11 @@ /*! * @class OFTarArchive OFTarArchive.h ObjFW/OFTarArchive.h * * @brief A class for accessing and manipulating tar archives. */ +OF_SUBCLASSING_RESTRICTED @interface OFTarArchive: OFObject { OFStream *_stream; enum { OF_TAR_ARCHIVE_MODE_READ, Index: src/OFTarArchiveEntry.h ================================================================== --- src/OFTarArchiveEntry.h +++ src/OFTarArchiveEntry.h @@ -59,10 +59,11 @@ OFDate *_modificationDate; of_tar_archive_entry_type_t _type; OFString *_Nullable _targetFileName; OFString *_Nullable _owner, *_Nullable _group; uint32_t _deviceMajor, _deviceMinor; + OF_RESERVE_IVARS(4) } /*! * @brief The file name of the entry. */ Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -88,10 +88,11 @@ @private OFString *_Nullable _name; # ifdef OF_HAVE_SOCKETS OFDNSResolver *_DNSResolver; # endif + OF_RESERVE_IVARS(4) } #endif #ifdef OF_HAVE_CLASS_PROPERTIES # ifdef OF_HAVE_THREADS Index: src/OFThreadPool.h ================================================================== --- src/OFThreadPool.h +++ src/OFThreadPool.h @@ -39,10 +39,11 @@ * @brief A class providing a pool of reusable threads. * * @note When the thread pool is released, all threads will terminate after * they finish the job they are currently processing. */ +OF_SUBCLASSING_RESTRICTED @interface OFThreadPool: OFObject { size_t _size; OFMutableArray *_threads; volatile int _count; Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -40,10 +40,11 @@ /*! * @class OFTimer OFTimer.h ObjFW/OFTimer.h * * @brief A class for creating and firing timers. */ +OF_SUBCLASSING_RESTRICTED @interface OFTimer: OFObject { OFDate *_fireDate; of_time_interval_t _interval; id _target; Index: src/OFTriple.h ================================================================== --- src/OFTriple.h +++ src/OFTriple.h @@ -33,10 +33,11 @@ #endif { FirstType _Nullable _firstObject; SecondType _Nullable _secondObject; ThirdType _Nullable _thirdObject; + OF_RESERVE_IVARS(4) } /*! * @brief The first object of the triple. */ Index: src/OFUDPSocket.h ================================================================== --- src/OFUDPSocket.h +++ src/OFUDPSocket.h @@ -123,10 +123,11 @@ #ifdef OF_WII uint16_t _port; #endif bool _blocking; id _Nullable _delegate; + OF_RESERVE_IVARS(4) } /*! * @brief Whether the socket is in blocking mode. * Index: src/OFURL.h ================================================================== --- src/OFURL.h +++ src/OFURL.h @@ -35,10 +35,11 @@ OFString *_Nullable _URLEncodedScheme, *_Nullable _URLEncodedHost; OFNumber *_Nullable _port; OFString *_Nullable _URLEncodedUser, *_Nullable _URLEncodedPassword; OFString *_Nullable _URLEncodedPath; OFString *_Nullable _URLEncodedQuery, *_Nullable _URLEncodedFragment; + OF_RESERVE_IVARS(4) } /*! * @brief The scheme part of the URL. */ Index: src/OFURLHandler.h ================================================================== --- src/OFURLHandler.h +++ src/OFURLHandler.h @@ -32,10 +32,11 @@ * @brief A handler for a URL scheme. */ @interface OFURLHandler: OFObject { OFString *_scheme; + OF_RESERVE_IVARS(4) } /*! * @brief The scheme this OFURLHandler handles. */ Index: src/OFValue.h ================================================================== --- src/OFValue.h +++ src/OFValue.h @@ -23,10 +23,14 @@ * @class OFValue OFValue.h ObjFW/OFValue.h * * @brief A class for storing arbitrary values in an object. */ @interface OFValue: OFObject +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief The ObjC type encoding of the value. */ @property (readonly, nonatomic) const char *objCType; Index: src/OFWin32ConsoleStdIOStream.h ================================================================== --- src/OFWin32ConsoleStdIOStream.h +++ src/OFWin32ConsoleStdIOStream.h @@ -19,10 +19,11 @@ #import "OFStdIOStream.h" OF_ASSUME_NONNULL_BEGIN +OF_SUBCLASSING_RESTRICTED @interface OFWin32ConsoleStdIOStream: OFStdIOStream { HANDLE _handle; of_char16_t _incompleteUTF16Surrogate; char _incompleteUTF8Surrogate[4]; Index: src/OFWindowsRegistryKey.h ================================================================== --- src/OFWindowsRegistryKey.h +++ src/OFWindowsRegistryKey.h @@ -26,10 +26,11 @@ /*! * @class OFWindowsRegistryKey \ * OFWindowsRegistryKey.h ObjFW/OFWindowsRegistryKey.h */ +OF_SUBCLASSING_RESTRICTED @interface OFWindowsRegistryKey: OFObject { HKEY _hKey; bool _close; } Index: src/OFXMLAttribute.h ================================================================== --- src/OFXMLAttribute.h +++ src/OFXMLAttribute.h @@ -31,10 +31,11 @@ #if defined(OF_XML_ELEMENT_M) || defined(OF_XML_PARSER_M) @public #endif OFString *_name, *_Nullable _namespace, *_stringValue; bool _useDoubleQuotes; + OF_RESERVE_IVARS(4) } /*! * @brief The name of the attribute. */ Index: src/OFXMLCDATA.h ================================================================== --- src/OFXMLCDATA.h +++ src/OFXMLCDATA.h @@ -25,10 +25,11 @@ * @brief A class representing XML CDATA. */ @interface OFXMLCDATA: OFXMLNode { OFString *_CDATA; + OF_RESERVE_IVARS(4) } /*! * @brief Creates a new OFXMLCDATA with the specified string. * Index: src/OFXMLCharacters.h ================================================================== --- src/OFXMLCharacters.h +++ src/OFXMLCharacters.h @@ -25,10 +25,11 @@ * @brief A class representing XML characters. */ @interface OFXMLCharacters: OFXMLNode { OFString *_characters; + OF_RESERVE_IVARS(4) } /*! * @brief Creates a new OFXMLCharacters with the specified string. * Index: src/OFXMLComment.h ================================================================== --- src/OFXMLComment.h +++ src/OFXMLComment.h @@ -25,10 +25,11 @@ * @brief A class for representing XML comments. */ @interface OFXMLComment: OFXMLNode { OFString *_comment; + OF_RESERVE_IVARS(4) } /*! * @brief Creates a new OFXMLComment with the specified string. * Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -36,10 +36,11 @@ OFString *_name, *_Nullable _namespace, *_Nullable _defaultNamespace; OFMutableArray OF_GENERIC(OFXMLAttribute *) *_Nullable _attributes; OFMutableDictionary OF_GENERIC(OFString *, OFString *) *_Nullable _namespaces; OFMutableArray OF_GENERIC(OFXMLNode *) *_Nullable _children; + OF_RESERVE_IVARS(4) } /*! * @brief The name of the element. */ Index: src/OFXMLElementBuilder.h ================================================================== --- src/OFXMLElementBuilder.h +++ src/OFXMLElementBuilder.h @@ -102,10 +102,11 @@ * * It can also be used to build OFXMLElements from parts of the document by * first parsing stuff using the OFXMLParser with another delegate and then * setting the OFXMLElementBuilder as delegate for the parser. */ +OF_SUBCLASSING_RESTRICTED @interface OFXMLElementBuilder: OFObject { OFMutableArray OF_GENERIC(OFXMLElement *) *_stack; id _Nullable _delegate; } Index: src/OFXMLNode.h ================================================================== --- src/OFXMLNode.h +++ src/OFXMLNode.h @@ -26,10 +26,14 @@ * @class OFXMLNode OFXMLNode.h ObjFW/OFXMLNode.h * * @brief A class which stores an XML element. */ @interface OFXMLNode: OFObject +{ + OF_RESERVE_IVARS(4) +} + /*! * @brief The contents of the node as a string value. * * For an @ref OFXMLElement, setting it removes all children and creates a * single child with the specified string value. Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -127,10 +127,11 @@ * @brief An event-based XML parser. * * OFXMLParser is an event-based XML parser which calls the delegate's callbacks * as soon as it finds something, thus suitable for streams as well. */ +OF_SUBCLASSING_RESTRICTED @interface OFXMLParser: OFObject { id _Nullable _delegate; enum of_xml_parser_state { OF_XMLPARSER_IN_BYTE_ORDER_MARK, Index: src/OFXMLProcessingInstructions.h ================================================================== --- src/OFXMLProcessingInstructions.h +++ src/OFXMLProcessingInstructions.h @@ -26,10 +26,11 @@ * @brief A class for representing XML processing instructions. */ @interface OFXMLProcessingInstructions: OFXMLNode { OFString *_processingInstructions; + OF_RESERVE_IVARS(4) } /*! * @brief Creates a new OFXMLProcessingInstructions with the specified string. * Index: src/OFZIPArchive.h ================================================================== --- src/OFZIPArchive.h +++ src/OFZIPArchive.h @@ -29,10 +29,11 @@ /*! * @class OFZIPArchive OFZIPArchive.h ObjFW/OFZIPArchive.h * * @brief A class for accessing and manipulating ZIP files. */ +OF_SUBCLASSING_RESTRICTED @interface OFZIPArchive: OFObject { OFStream *_stream; int64_t _offset; enum { Index: src/OFZIPArchiveEntry.h ================================================================== --- src/OFZIPArchiveEntry.h +++ src/OFZIPArchiveEntry.h @@ -110,10 +110,11 @@ OFString *_Nullable _fileComment; uint32_t _startDiskNumber; uint16_t _internalAttributes; uint32_t _versionSpecificAttributes; int64_t _localFileHeaderOffset; + OF_RESERVE_IVARS(4) } /*! * @brief The file name of the entry. */ Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -122,10 +122,25 @@ # else # /* Hopefully no arch needs more than 16 byte alignment */ # define OF_BIGGEST_ALIGNMENT 16 # endif #endif + +#define OF_PREPROCESSOR_CONCAT2(a, b) a##b +#define OF_PREPROCESSOR_CONCAT(a, b) OF_PREPROCESSOR_CONCAT2(a, b) + +#if __OBJFW_RUNTIME_ABI__ || (defined(OF_APPLE_RUNTIME) && defined(__OBJC2__)) +# define OF_HAVE_NONFRAGILE_IVARS +#endif + +#ifdef OF_HAVE_NONFRAGILE_IVARS +# define OF_RESERVE_IVARS(num) +#else +# define OF_RESERVE_IVARS(num) \ + @private \ + void *OF_PREPROCESSOR_CONCAT(_reserved, __COUNTER__)[num]; +#endif #ifdef __GNUC__ # define OF_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) #else # define OF_GCC_VERSION 0 @@ -403,12 +418,10 @@ abort(); \ \ [super dealloc]; /* Get rid of a stupid warning */ #endif -#define OF_PREPROCESSOR_CONCAT2(a, b) a##b -#define OF_PREPROCESSOR_CONCAT(a, b) OF_PREPROCESSOR_CONCAT2(a, b) #define OF_CONSTRUCTOR(prio) \ static void __attribute__((__constructor__(prio))) \ OF_PREPROCESSOR_CONCAT(constructor, __LINE__)(void) #define OF_DESTRUCTOR(prio) \ static void __attribute__((__destructor__(prio))) \