John:

Objects respect scope so they don't have to be explicitly cleared. That's
different than an hList or our favorite word processor. :-)

Also, 4D uses "ref counting" when it works with C_Object so that makes them
even more memory efficient.



--
Douglas von Roeder
949-336-2902

On Fri, Dec 15, 2017 at 8:44 AM, John Baughman via 4D_Tech <
[email protected]> wrote:

> If I am making multiple calls to a method and passing parameters via a
> C_OBJECT, is their any memory issues using New object. For example…
>
> $printedHeight:=Timesheets_BuildReport (New object("line";"employeeLine1";
> "employee";$employeeName;"taskdate";!2017-01-02!))
> $printedHeight:=Timesheets_BuildReport (New object("line";"employeeLine";"
> employee";$employeeName;"taskdate";!2017-01-03!))
> $printedHeight:=Timesheets_BuildReport (New object("line";"employeeLine";"
> employee";$employeeName;"taskdate";!2017-01-07!))
>
> // Timesheets_BuildReport  consumes the passed parameter...
>      C_OBJECT($oLineParams;$1)
>      $oLineParams:=$1
>
> I got to thinking about what happens to the C_OBJECT after
> Timesheets_BuildReport consumes it. Does it hang around in memory? My
> thinking is that since it’s being saved to a local variable, it will die
> when Timesheets_BuildReport ends.
>
> Should I rethink this and populate a single C_OBJECT as I go?
>
> thanks,
>
> John
>
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> [email protected]
>
>
>
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to