X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2Fblog-0023.html-inc;h=8451d0cad9fffac62cf3d01e8ef56f55afa6d4fd;hb=b2c46b060afb65aa63414ea0fabbe500e44917d7;hp=07f93572e8222cb208caab774a8da5e5cca131dd;hpb=638b5b9759c7dcb4de4c0a88c766e9f9dd650348;p=sdlgit%2FSDL-Site.git diff --git a/pages/blog-0023.html-inc b/pages/blog-0023.html-inc index 07f9357..8451d0c 100644 --- a/pages/blog-0023.html-inc +++ b/pages/blog-0023.html-inc @@ -1,6 +1,20 @@

-Catching memory leaks in XS +Newbie Friendly Perl Projects

-
 I slay dragons, yonder

So I am trying to find and plug memory leaks in SDL perl. Most of the memory leaks occur because in XS a reference is still held. One very expensive mem leak was caught by TELS really early on here. The problem occurs where in XS there is

RETVAL = (cast *) safemalloc( ... );
 and safefree(...) is never called.
Here is a in code example lines 1082 on.

My question is how I can mitigate these memory leaks? One idea I had was to store all malloc'd pointers to an array that is safefree'd on DESTROY or hooked into perl GC somehow .


Any guidance is helpful.

--yapgh
\ No newline at end of file +
A seed needs soft soil and water to grow
This is a reply to szabgab's post on how to get newbies interested in Perl modules. Being a newbie in Perl myself I thought I should take a shot.
+
+I was thinking you can make projects more accessible to newbies by having a step by step plan included with where they need to look. For example for docs of SDL_perl:
+
  1. Look at SDL docs [link]
  2. +
  3. See where SDL_perl is using the same functions [link] and the docs to this file [link]
  4. +
  5. Use the pod format to add it to the source [link to using pod]
  6. +
  7. {BONUS} Come up with tutorial or cookbook [link to example]
  8. +
  9. Submit code to github [link] or email them to me [link]
    +
  10. +

+Basically assume nothing is known. I know this may seem demeaning but I am a newbie to Perl and sometimes I hate looking for crust (docs). I call it crust because a crust is useful for me to eat a pizza slice, but it has no flavor .
+
+--yapgh
+


+

\ No newline at end of file