Re: [PATCH v4 25/25] reftable/basics: ban standard allocator functions

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

 



Patrick Steinhardt <ps@xxxxxx> writes:

> +#ifndef REFTABLE_ALLOW_BANNED_ALLOCATORS
> +# define REFTABLE_BANNED(func) use_reftable_##func##_instead

We'd need to mimic banned.h a bit better, by adding

#undef malloc
#undef realloc
#undef free
#undef calloc
#undef strdup

before (potentially re-)defining them.

> +# define malloc(sz) REFTABLE_BANNED(malloc)
> +# define realloc(ptr, sz) REFTABLE_BANNED(realloc)
> +# define free(ptr) REFTABLE_BANNED(free)
> +# define calloc(nelem, elsize) REFTABLE_BANNED(calloc)
> +# define strdup(str) REFTABLE_BANNED(strdup)
> +#endif




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux