ObjFW  Diff

Differences From Artifact [f4b3f5f3f4]:

To Artifact [f60148ac98]:


603
604
605
606
607
608
609

















































610
611
612
613
614
615
616
 * class.
 *
 * @param object The object to add to the topmost autorelease pool
 * @return The autoreleased object
 */
extern id _Nullable _objc_rootAutorelease(id _Nullable 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;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
 * class.
 *
 * @param object The object to add to the topmost autorelease pool
 * @return The autoreleased object
 */
extern id _Nullable _objc_rootAutorelease(id _Nullable object);

/*!
 * @brief Sets the tagged pointer secret.
 *
 * @param secret A secret, random value that will be used to XOR all tagged
 *		 pointers with
 */
extern void objc_setTaggedPointerSecret(uintptr_t secret);

/*!
 * @brief Registers a class for tagged pointers.
 *
 * @param class The class to register for tagged pointers
 * @return The tagged pointer ID for the registered class
 */
extern int objc_registerTaggedPointerClass(Class _Nonnull class);

/*!
 * @brief Returns whether the specified object is a tagged pointer.
 *
 * @param object The object to inspect
 * @return Whether the specified object is a tagged pointer
 */
static inline bool
object_isTaggedPointer(id _Nullable object)
{
	uintptr_t pointer = (uintptr_t)object;

	return pointer & 1;
}

extern Class _Nullable object_getTaggedPointerClass(id _Nonnull object);

/*!
 * @brief Returns the value of the specified tagged pointer.
 *
 * @param object The object whose tagged pointer value should be returned
 * @return The tagged pointer value of the object
 */
extern uintptr_t object_getTaggedPointerValue(id _Nonnull object);

/*!
 * @brief Creates a new tagged pointer.
 *
 * @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);

/*
 * 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;