#13 criticisms on the XS code by bulk88

POGL 0.xx
open
nobody
None
5
2014-05-03
2014-05-03
Mithaldu
No

21:57:26 (@bulk88) why woudl rpn_push be called with a NULL *?

22:13:12 (@bulk88) https://github.com/wchristian/OpenGL.pm/blob/debuggery/pogl_rpn.xs#L304 a smart person would strlen then it, then switch the length, then memcmp it
22:13:28 (@bulk88) *switch()
22:13:57 (@Mithaldu) to reduce the number of useless string comparisons?
22:15:27 (@bulk88) yes, and less trlens, of right and left sides
22:15:32 (@bulk88) of the strcmp
22:15:51 (@bulk88) also your leaks are probably because the code mixes malloc with croak all over the place
22:17:21 (@bulk88) if you malloc, unless you immeditaly connect the ptr to a perl data structure that is subject to perl GC (mortals, save stack, put in a MG struct in some SV), you will probably leak it

22:24:45 (@bulk88) if (sv != &PL_sv_undef && sv_derived_from(sv,"OpenGL::Array"))""
22:24:51 (@bulk88) sv != &PL_sv_undef
22:25:03 (@bulk88) thats not how you check for undef
22:26:08 (@Mithaldu) so how do you?
22:26:43 (@bulk88) SvOK
22:26:53 (@bulk88) but SvOK uis magic unaware
22:27:15 (@bulk88) I dont care much about magic, but my $var = undef; sumsub($var);
22:27:36 (@bulk88) and sumsub(undef) should never have different behavior
22:29:09 (@bulk88) of course, the docs (which i didnt read) may intentionally use litteral undef vs undef in a SV for something

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks