Updating prototypes for sasl_malloc_t/sasl_calloc_t/.. to use size_t

Howard Chu hyc at highlandsun.com
Tue May 29 12:13:25 EDT 2012


Alexey Melnikov wrote:
> I would like to update prototypes for sasl_malloc_t and friends in
> sasl.h to use size_t. Current prototypes are invalid, in particular on
> 64 bit Windows. Any concerns about this change?

Sounds like a good idea, and necessary regardless.
>
> diff --git a/include/sasl.h b/include/sasl.h
> index 5bbbbfb..2ac5300 100755
> --- a/include/sasl.h
> +++ b/include/sasl.h
> @@ -225,9 +225,9 @@ extern "C" {
>
>    /* memory allocation functions which may optionally be replaced:
>     */
> -typedef void *sasl_malloc_t(unsigned long);
> -typedef void *sasl_calloc_t(unsigned long, unsigned long);
> -typedef void *sasl_realloc_t(void *, unsigned long);
> +typedef void *sasl_malloc_t(size_t);
> +typedef void *sasl_calloc_t(size_t, size_t);
> +typedef void *sasl_realloc_t(void *, size_t);
>    typedef void sasl_free_t(void *);
>
>    LIBSASL_API void sasl_set_alloc(sasl_malloc_t *,
>
>


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/




More information about the Cyrus-sasl mailing list