[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad.esfahbod at gmail.com
Sat Oct 3 06:00:12 PDT 2015
On 15-10-03 01:55 PM, Konstantin Ritt wrote:
> Can not one do this by defining his own malloc/../free in config.h + passing
> -DHAVE_CONFIG instead?
I thought that probably blows up inside stdlib.h...
> Regards,
> Konstantin
>
> 2015-10-03 16:21 GMT+04:00 Behdad Esfahbod <behdad at kemper.freedesktop.org
> <mailto:behdad at kemper.freedesktop.org>>:
>
> src/hb-private.hh | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> New commits:
> commit 52b418555b62a3b25399f202c1fa72ab7288c224
> Author: Behdad Esfahbod <behdad at behdad.org <mailto:behdad at behdad.org>>
> Date: Sat Oct 3 13:20:55 2015 +0100
>
> Allow compiling with custom allocators
>
> User can define hb_malloc_impl, etc, to name of custom allocator functions
> that have the same signature as malloc.
>
> diff --git a/src/hb-private.hh b/src/hb-private.hh
> index 07550cb..165cd0d 100644
> --- a/src/hb-private.hh
> +++ b/src/hb-private.hh
> @@ -54,6 +54,23 @@
> #include <stdarg.h>
>
>
> +/* Compile-time custom allocator support. */
> +
> +#if defined(hb_malloc_impl) \
> + && defined(hb_calloc_impl) \
> + && defined(hb_realloc_impl) \
> + && defined(hb_free_impl)
> +extern void* hb_malloc_impl(size_t size);
> +extern void* hb_calloc_impl(size_t nmemb, size_t size);
> +extern void* hb_realloc_impl(void *ptr, size_t size);
> +extern void hb_free_impl(void *ptr);
> +#define malloc hb_malloc_impl
> +#define calloc hb_calloc_impl
> +#define realloc hb_realloc_impl
> +#define free hb_free_impl
> +#endif
> +
> +
> /* Compiler attributes */
>
>
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org <mailto:HarfBuzz at lists.freedesktop.org>
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>
>
>
>
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>
More information about the HarfBuzz
mailing list