Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <em>variables</em> here are <code>i</code> and <code>images</code> (and even the <code>images</code> I can't be sure about without seeing the declaration - it could be a field). <code>images</code> here is just a reference to (it looks like) a <code>List&lt;Image&gt;</code> - so the entire of <code>images</code> is either 4 or 8 bytes. The list itself will take more space; there is the object itself, plus the backing array, plus a few counters. Swapping an item in a list, as with swapping an element in an array, does not involve allocating any extra room in the list/array.</p> <p>The one thing that <em>could</em> (and almost certainly <em>does</em>) cause allocation here is the <code>IProcessing.Color_style</code>. It <em>sounds</em> like this will be creating a new image based on an old image (rather than changing the old image in place). Furthermore, it <em>looks</em> a lot like you aren't disposing the old image - so if this is the <em>only</em> place you are using that image, you could be causing yourself a few problems: images are <code>IDisposable</code> and are linked to GDI+ handles; if you don't dispose them you can get problems with <code>OutOfMemoryException</code> that isn't linked to <em>memory</em>, but actually to GDI+ handles. Especially if you have a lot of spare memory, so that garbage collection doesn't happen very frequently. Of course, this is also slightly complicated because if you <em>are</em> using that image elsewhere (on a control, etc), then you <strong><em>do not</em></strong> want to dispose it now!</p> <p>A line does not need to involve <code>new</code> to involve an allocation (allocations can be hidden behind method-calls, operators, properties); likewise, not every line involving <code>new</code> requires an allocation (value-types are initialized over the top of the existing location).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload