# if defined(PERL_IMPLICIT_SYS)
# endif
#endif
-#if defined(MYMALLOC)
#define malloc Perl_malloc
#define calloc Perl_calloc
#define realloc Perl_realloc
#define mfree Perl_mfree
+#if defined(MYMALLOC)
#define malloced_size Perl_malloced_size
#endif
#define get_context Perl_get_context
# endif
#endif
-#if defined(MYMALLOC)
Ajnop |Malloc_t|malloc |MEM_SIZE nbytes
Ajnop |Malloc_t|calloc |MEM_SIZE elements|MEM_SIZE size
Ajnop |Malloc_t|realloc |Malloc_t where|MEM_SIZE nbytes
Ajnop |Free_t |mfree |Malloc_t where
+#if defined(MYMALLOC)
jnp |MEM_SIZE|malloced_size |void *p
#endif
emit_symbols [qw(
Perl_dump_mstats
Perl_get_mstats
- Perl_malloc
- Perl_mfree
- Perl_realloc
- Perl_calloc
Perl_strdup
Perl_putenv
)];
PL_malloc_mutex
Perl_dump_mstats
Perl_get_mstats
- Perl_malloc
- Perl_mfree
- Perl_realloc
- Perl_calloc
Perl_malloced_size
)];
}
# endif
#endif
-#if defined(MYMALLOC)
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);
PERL_CALLCONV Free_t Perl_mfree(Malloc_t where);
+#if defined(MYMALLOC)
PERL_CALLCONV MEM_SIZE Perl_malloced_size(void *p);
#endif
#endif /* LEAKTEST */
+/* These must be defined when not using Perl's malloc for binary
+ * compatibility */
+
+#ifndef MYMALLOC
+
+Malloc_t Perl_malloc (MEM_SIZE nbytes)
+{
+ dTHXs;
+ return PerlMem_malloc(nbytes);
+}
+
+Malloc_t Perl_calloc (MEM_SIZE elements, MEM_SIZE size)
+{
+ dTHXs;
+ return PerlMem_calloc(elements, size);
+}
+
+Malloc_t Perl_realloc (Malloc_t where, MEM_SIZE nbytes)
+{
+ dTHXs;
+ return PerlMem_realloc(where, nbytes);
+}
+
+Free_t Perl_mfree (Malloc_t where)
+{
+ dTHXs;
+ PerlMem_free(where);
+}
+
+#endif
+
/* copy a string up to some (non-backslashed) delimiter, if any */
char *