develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #114248] perlclib differs from perlapi regarding Newx and related functions

Thread Next
James E Keenan via RT
July 23, 2012 17:14
[perl #114248] perlclib differs from perlapi regarding Newx and related functions
Message ID:
On Mon Jul 23 15:06:13 2012, BKB wrote:
> The Perlclib documentation contains a discrepancy with the Perlapi
> documentation for the functions Newx and related functions. Perlclib
> gives these an initial argument of "id" but Perlapi does not mention
> the "id" argument.

The relevant code in pod/perlclib.pod dates to 2005-07-12.

    102     t* p = malloc(n)                Newx(id, p, n, t)
    103     t* p = calloc(n, s)             Newxz(id, p, n, t)

pod/perlapi.pod is not source code POD.  Rather, it's built up from
documentation in source code files.  The source code file in question
appears to be handy.h.  But, surprisingly, the relevant code in handy.h
dates to 2005-07-11!

   1052 =for apidoc Am|void|Newx|void* ptr|int nitems|type
   1053 The XSUB-writer's interface to the C C<malloc> function.
   1055 In 5.9.3, Newx() and friends replace the older New() API, and drops
   1056 the first parameter, I<x>, a debug aid which allowed callers to
   1057 themselves.  This aid has been superseded by a new build option,
   1058 PERL_MEM_LOG (see L<perlhacktips/PERL_MEM_LOG>).  The older API
is still
   1059 there for use in XS modules supporting older perls.
   1232 #define Newx(v,n,t)     (v = (MEM_WRAP_CHECK_(n,t)
   1233 #define Newxc(v,n,t,c)  (v = (MEM_WRAP_CHECK_(n,t)
   1234 #define Newxz(v,n,t)    (v = (MEM_WRAP_CHECK_(n,t)
   1236 #ifndef PERL_CORE
   1237 /* pre 5.9.x compatibility */
   1238 #define New(x,v,n,t)    Newx(v,n,t)
   1239 #define Newc(x,v,n,t,c) Newxc(v,n,t,c)
   1240 #define Newz(x,v,n,t)   Newxz(v,n,t)
   1241 #endif

We'll need some suggestions from people more knowledgeable about these

Thank you very much.

via perlbug:  queue: perl5 status: new

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About