diff --git a/pod/perlclib.pod b/pod/perlclib.pod index 8259682dd1e8..091be6828ff3 100644 --- a/pod/perlclib.pod +++ b/pod/perlclib.pod @@ -166,7 +166,10 @@ should use C instead: p = realloc(p, n) Renew(p, n, t) It is not portable to try to allocate 0 bytes; allocating 1 or more is -portable. +portable. Never pass pointers between C, C, C and +I equivalents C, C, C. They are not from the +same memory pool or allocator. Either an instant or delayed I will +occur, or subtle memory leaks or subtle heap corruption. memcpy(dst, src, n) Copy(src, dst, n, t) memmove(dst, src, n) Move(src, dst, n, t) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 7e2cb30bf842..1224f68de5aa 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -180,15 +180,20 @@ XXX Changes which significantly change existing files in F go here. However, any changes to F should go in the L section. + + Additionally, the following selected changes have been made: -=head3 L +=head3 F and F =over 4 -=item * +=item Memory Allocation in C/XS -XXX Description of the change here +Documentation was updated to reflect that mixing C, C, and +C vs C, C, and C not allowed, and mixing +pointers between the 2 classes of APIs is not allowed. Updates made in +F and F. =back diff --git a/pod/perlguts.pod b/pod/perlguts.pod index df6404c36874..2dd712e91dca 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -2384,7 +2384,10 @@ marked with correct flags. All memory meant to be used with the Perl API functions should be manipulated using the macros described in this section. The macros provide the necessary transparency between differences in the actual malloc implementation that is -used within perl. +used within perl. Never pass pointers between C, C, C +and I equivalents C, C, C. They are not from the +same memory pool or allocator. Either an instant or delayed I will +occur, or subtle memory leaks or subtle heap corruption. The following three macros are used to initially allocate memory :