Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 1282565161e1fd0319cec90bb7fd9c237aa0fb04
      
https://github.com/Perl/perl5/commit/1282565161e1fd0319cec90bb7fd9c237aa0fb04
  Author: Daniel Dragan <bul...@hotmail.com>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M pod/perlclib.pod
    M pod/perldelta.pod
    M pod/perlguts.pod

  Log Message:
  -----------
  Update POD for Newx/Renew/Safefree vs libc analogs about heap corruption

This isn't documented anywhere except in perlapi, in the
per-macro/per-function section. A seasoned dev, will read perlguts ONCE,
write code, then pass a Newx() pointer, to some 3rd party library or
native OS API, and then instant disaster, or invisible disaster. If
Newx() and libc malloc() pointers are interchangeable, on ONE particular
OS, with ONE particular perl build, with ONE particular set of build
flags, that is undefined behavior. Have fun with #define USE_MDH
or -DUSE_MDH or -DDEBUGGING or #define MYMALLOC -DMYMALLOC.

Also, for anyone reading this in the future.

DO NOT EVER DOCUMENT the permutations where Newx() is libc malloc().

Perl core reserves the right, to separate Newx() and malloc(), at any time
in a maint release if there are technical reasons to do so.

Also libperl.so/.dll embedders, if libperl is unloaded from the process,
and deallocs all Newx() blocks globally, and a 3rd party library still
loaded in the process, thinking it owns that "malloc()" block, that was
given ownership of, in 3rd party lib API contract, SEGV time.



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to