I have 5Mb string and 5M objects that should reference it. So, if i write a.src = new String(s) instead of a.src = s, they will share it? 
-
-
Replying to @DmitryBaranovsk
@DmitryBaranovsk The objects (wrappers) won't be shared, but the 5Mb string will.1 reply 1 retweet 1 like -
Replying to @slightlylate
@slightlylate So primitive will be shared, while object will be copied? Shouldn’t be opposite?3 replies 0 retweets 0 likes -
Replying to @DmitryBaranovsk
@dmitrybaranovsk OTOH, if there was just one `var S = new String(s)` wrapper, and all objs did obj.src = S, all shared, no?@slightlylate1 reply 0 retweets 0 likes -
Replying to @getify
@getify : in that case, only pointer to obj per ".src". /cc@DmitryBaranovsk1 reply 0 retweets 0 likes -
Replying to @slightlylate
@slightlylate FWIW, surprised that: var s = "foo", S1 = new String(s), S2 = new String(s); would not copy "foo" twice. no?1 reply 0 retweets 0 likes
-
-
Replying to @slightlylate
@slightlylate is this related with something like "copy on write" technique? because I've seen it's used as a way to control memory usage0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.