[m-dev.] MR_{save/restore}_transient_hp().

Paul Bone paul at bone.id.au
Thu Jul 24 12:17:30 AEST 2014

Hi Guys.

A number of memory allocation functions and macros, including
MR_allocate_bitmap_msg, say that they should be used with
MR_{save/restore}_transient_hp() when called from C.  While this is only
relevant for grades where the heap pointer is actually used I'd rather not
add to the bitrot of those grades.

What I don't know is when this says "from C" does it mean from foreign_proc
macros?  And do I understand correctly that the concern is that the heap
pointer is saved in a register that may be clobbered by external C code, and
therefore I need to restore that pointer before allocating memory and save
it again after allocating the memory?


Paul Bone

More information about the developers mailing list