parrot/parrot — Issue #727: Memory related (non-GC version) macros are deprecated and will be removed.
Author: bacek
Created: 2012-03-05 10:09:26+00:00
State: open

Hello.

Next macros:

#define mem_sys_memcopy memcpy
#define mem_sys_memmove memmove

#define mem_allocate_typed(type) (type *)mem_sys_allocate(sizeof (type))
#define mem_allocate_n_typed(n, type) (type *)mem_sys_allocate((n) * sizeof (type))
#define mem_allocate_zeroed_typed(type) (type *)mem_sys_allocate_zeroed(sizeof (type))
#define mem_allocate_n_zeroed_typed(n, type) (type *)mem_sys_allocate_zeroed((n) * sizeof (type))
#define mem_realloc_n_typed(p, n, type) (p) = (type *)mem_sys_realloc((p), (n) * sizeof (type))

have nothing to do with parrot functionality and just custom macros for malloc/free. They are not part of parrot's provided facilities and will be removed.

Any HLL should move to use:
1. Standard malloc/free functions.
2. Or better, GC backed mem_gc_* macros.

--
Bacek