Shop OBEX P1 Docs P2 Docs Learn Events
use of multiple identical objects in spin2 — Parallax Forums

use of multiple identical objects in spin2

when I have 4 of these X Band devices hooked up, and code it this way, does it use 4x the memory? Do I have to make a clever multipin X Band Object to make better use of memory?

Comments

  • RaymanRayman Posts: 15,731

    Pretty sure uses 1X the memory, unless you have a VAR section.
    Each would get its own copy of things in VAR sections...

    At least, that's the way remember it...

  • evanhevanh Posts: 16,780

    Not hard to test. See how much the compiled file size increases when adding first object compared to adding more copies.

  • JonnyMacJonnyMac Posts: 9,470

    Code and DAT sections are shared between instances. The VAR section of the object is duplicated to be unique for each instance.

    Quick test with my version of the x-band object.

    #    Code  Delta    Vars  Delta
    -    ----  -----    ----  -----
    0    2448      0     556      0
    1    2552    104     572     16
    2    2560      8     588     16
    
  • oh, right... thanks all. I should pay more attention to the "Object Info" viewer.

Sign In or Register to comment.