Overview
Comment: | runtime: Add support for associated objects |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
18ae339de1648d257408143f2607715d |
User & Date: | js on 2024-02-03 14:41:14 |
Other Links: | manifest | tags |
References
2024-02-03
| ||
14:43 | • Fixed ticket [4b06796f49]: runtime: Add objc_setAssociatedObject() plus 5 other changes artifact: 9884ff5a3c user: js | |
Context
2024-02-03
| ||
15:50 | objc_destructInstance: Remove associated objects check-in: 5f4d70c69f user: js tags: trunk | |
14:41 | runtime: Add support for associated objects check-in: 18ae339de1 user: js tags: trunk | |
11:37 | Minor documentation improvement check-in: e03c6b5d9d user: js tags: trunk | |
Changes
Modified src/runtime/Makefile from [af674fab60] to [692471a52e].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | + | include ../../extra.mk SUBDIRS = lookup-asm DISTCLEAN = Info.plist SHARED_LIB = ${OBJFWRT_SHARED_LIB} STATIC_LIB = ${OBJFWRT_STATIC_LIB} FRAMEWORK = ${OBJFWRT_FRAMEWORK} LIB_MAJOR = ${OBJFWRT_LIB_MAJOR} LIB_MINOR = ${OBJFWRT_LIB_MINOR} LIB_PATCH = ${OBJFWRT_LIB_PATCH} SRCS = arc.m \ association.m \ autorelease.m \ category.m \ class.m \ dtable.m \ exception.m \ hashtable.m \ init.m \ |
︙ |
Modified src/runtime/ObjFWRT.h from [5258b334d9] to [8884ec4c85].
︙ | |||
169 170 171 172 173 174 175 176 177 178 179 180 181 182 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | + + + + + + + + + + + + + + + + | #ifdef __cplusplus Class _Nonnull class_; #else Class _Nonnull class; #endif }; /** * @brief A policy for object association, see @ref objc_setAssociatedObject. */ typedef enum objc_associationPolicy { /** @brief Associate the object like an assigned property. */ OBJC_ASSOCIATION_ASSIGN = 0, /** @brief Associate the object like a retained, nonatomic property. */ OBJC_ASSOCIATION_RETAIN_NONATOMIC = 1, /** @brief Associate the object like a retained property. */ OBJC_ASSOCIATION_RETAIN = OBJC_ASSOCIATION_RETAIN_NONATOMIC | 0x300, /** @brief Associate the object like a copied, nonatomic property. */ OBJC_ASSOCIATION_COPY_NONATOMIC = 3, /** @brief Associate the object like a copied property. */ OBJC_ASSOCIATION_COPY = OBJC_ASSOCIATION_COPY_NONATOMIC | 0x300 } objc_associationPolicy; #ifdef __cplusplus extern "C" { #endif /** * @brief Registers a selector with the specified name with the runtime. * |
︙ | |||
642 643 644 645 646 647 648 649 650 651 652 653 654 655 | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | * * @param class_ The tag ID for the tagged pointer class to use * @param value The value the tagged pointer should have * @return A tagged pointer, or `nil` if it could not be created */ extern id _Nullable objc_createTaggedPointer(int class_, uintptr_t value); /** * @brief Sets an associated object on the specified object for the specified * key. * * @param object The object on which to set an associated object * @param key A unique pointer to use as the key for the association * @param value The object to associate with the specified object * @param policy The association policy, see @ref objc_associationPolicy */ extern void objc_setAssociatedObject(id _Nonnull object, const void *_Nonnull key, id _Nullable value, objc_associationPolicy policy); /** * @brief Returns the associated object on the specified object for the * specified key. * * @param object The object on which to get the associated object * @param key The key of the association * @return The associated object on the specified object for the specified key */ extern id _Nullable objc_getAssociatedObject(id _Nonnull object, const void *_Nonnull key); /** * @brief Removes all associated objects for the specified object. * * @param object The object on which to remove all associated objects */ extern void objc_removeAssociatedObjects(id _Nonnull object); /* * Used by the compiler, but can also be called manually. * * These declarations are also required to prevent Clang's implicit * declarations which include __declspec(dllimport) on Windows. */ struct objc_module; |
︙ |
Added src/runtime/association.m version [b558229b1e].