Skip to content

Commit

Permalink
Fix calling conventions in malloc_ctl.h
Browse files Browse the repository at this point in the history
The Perl_malloc() etc. functions are *also* declared in
proto.h, so the declarations need to match.  The inclusion
of malloc_ctl.h into perl.h had to be moved down until
after the point where PERL_CALLCONV was completely defined.
  • Loading branch information
jandubois committed Oct 22, 2010
1 parent 8cc8659 commit 158cfab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions malloc_ctl.h
Expand Up @@ -14,14 +14,12 @@ struct perl_mstats {
};
typedef struct perl_mstats perl_mstats_t;

START_EXTERN_C
Malloc_t Perl_malloc (MEM_SIZE nbytes);
Malloc_t Perl_calloc (MEM_SIZE elements, MEM_SIZE size);
Malloc_t Perl_realloc (Malloc_t where, MEM_SIZE nbytes);
PERL_CALLCONV Malloc_t Perl_malloc (MEM_SIZE nbytes);
PERL_CALLCONV Malloc_t Perl_calloc (MEM_SIZE elements, MEM_SIZE size);
PERL_CALLCONV Malloc_t Perl_realloc (Malloc_t where, MEM_SIZE nbytes);
/* 'mfree' rather than 'free', since there is already a 'perl_free'
* that causes clashes with case-insensitive linkers */
Free_t Perl_mfree (Malloc_t where);
END_EXTERN_C
PERL_CALLCONV Free_t Perl_mfree (Malloc_t where);

#ifndef NO_MALLOC_DYNAMIC_CFG

Expand Down
8 changes: 4 additions & 4 deletions perl.h
Expand Up @@ -2387,10 +2387,6 @@ int isnan(double d);

#endif

#ifdef MYMALLOC
# include "malloc_ctl.h"
#endif

struct RExC_state_t;
struct _reg_trie_data;

Expand Down Expand Up @@ -4979,6 +4975,10 @@ struct tempsym; /* defined in pp_pack.c */
#define PERL_CKDEF(s) PERL_CALLCONV OP *s (pTHX_ OP *o);
#define PERL_PPDEF(s) PERL_CALLCONV OP *s (pTHX);

#ifdef MYMALLOC
# include "malloc_ctl.h"
#endif

#include "proto.h"

/* this has structure inits, so it cannot be included before here */
Expand Down

0 comments on commit 158cfab

Please sign in to comment.