Branch: Tag:

2014-07-27

2014-07-27 10:30:59 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Object: Added secure().

This function sets the OBJECT_CLEAR_ON_EXIT flag on the provided
object (analogous to String.secure() and STRING_CLEAR_ON_EXIT).

Also fixes the documented type of String.secure().

1336:    RETURN mkmapping(ind, val);   }    - /*! @decl void secure(string str) + /*! @decl string secure(string str)    *! @belongs String    *!    *! Marks the string as secure, which will clear the memory area
1350:    REF_RETURN str;   }    + /*! @decl object secure(object str) +  *! @belongs Object +  *! +  *! Marks the object as secure, which will clear the memory area +  *! before freeing the object. +  */ + PIKEFUN object object_secure(object obj) +  optflags OPT_SIDE_EFFECT; +  rawtype tFunc(tSetvar(0, tObj), tVar(0)); + { +  obj->flags |= OBJECT_CLEAR_ON_EXIT; +  REF_RETURN obj; + } +    /*! @decl int count(string haystack, string needle)    *! @belongs String    *!