#define XSH_HINTS_H 1
#include "caps.h" /* XSH_HAS_PERL(), XSH_THREADSAFE, tTHX */
+#include "mem.h" /* XSH_SHARED_*() */
#ifdef XSH_THREADS_H
# error threads.h must be loaded at the very end
#ifdef XSH_HINTS_VAL_DEINIT
# define XSH_HINTS_FREE(H) \
- if (H) XSH_HINTS_VAL_DEINIT(XSH_HINTS_VAL_GET(H)); \
- PerlMemShared_free(H)
+ if (H) XSH_HINTS_VAL_DEINIT(XSH_HINTS_VAL_GET(((xsh_hints_t *) (H)))); \
+ XSH_SHARED_FREE((H), 1, xsh_hints_t)
#else
-# define XSH_HINTS_FREE(H) PerlMemShared_free(H)
+# define XSH_HINTS_FREE(H) XSH_SHARED_FREE((H), 1, xsh_hints_t)
#endif
#else /* XSH_HINTS_NEED_STRUCT */
#ifdef XSH_HINTS_FREE
# define PTABLE_NAME ptable_hints
-# define PTABLE_VAL_FREE(V) XSH_HINTS_FREE((xsh_hints_t *) (V))
+# define PTABLE_VAL_FREE(V) XSH_HINTS_FREE(V)
#else
# define PTABLE_USE_DEFAULT 1
#endif
xsh_hints_t *h2;
#if XSH_HINTS_NEED_STRUCT
- h2 = PerlMemShared_malloc(sizeof *h2);
+ XSH_SHARED_ALLOC(h2, 1, xsh_hints_t);
# if XSH_WORKAROUND_REQUIRE_PROPAGATION
h2->require_tag = PTR2UV(xsh_dup_inc(INT2PTR(SV *, h1->require_tag), ud->params));
# endif
return newSVuv(0);
#if XSH_HINTS_NEED_STRUCT
- h = PerlMemShared_malloc(sizeof *h);
+ XSH_SHARED_ALLOC(h, 1, xsh_hints_t);
# if XSH_WORKAROUND_REQUIRE_PROPAGATION
h->require_tag = xsh_require_tag();
# endif