Re: [RFC PATCH] <linux/taggedptr.h>: Introduce tagged pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 28, 2018 at 05:06:29PM +0800, Gao Xiang wrote:
> Therefore, this patch introduces simple generic methods to fold
> tags into a pointer integer. It currently reuses the last 2 bits
> of the pointer for tags, which are safely for all modern platforms.

The m68k people will have your head.  alignof(unsigned long) == 2 on
m68k.  Now, kmalloc always returns 8-byte aligned quantities, but
if you have:

static unsigned long foo;

then ((unsigned long)&foo & 2) may be non-zero.

> +/*
> + * mark these special integers as another type
> + * in order to highlight the tagged pointer usage.
> + */
> +typedef uintptr_t	taggedptr_t;

I find this a bit verbose.  How about tagptr_t ?




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux