Having uninitilaized Protected variables

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
technicorn
Enthusiast
Enthusiast
Posts: 105
Joined: Wed Jan 18, 2006 7:40 pm
Location: Hamburg

Having uninitilaized Protected variables

Post by technicorn »

Having the possiblity to have Protected variables in Procedures that are not initialized to zero,
would speed up Procedure calls a lot if you have many variables in it, that are set to other values than zero anyway.
Only exception would be strings, which pointer have to be set to zero
for the initial assignment to work.

Maybe a ProtectedUnitialized v1.l, v2.l v3.l
or
Protected v1.l = ?, v2.l = ?, v3.l = ?

Thanks
Technicorn
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Actually, since the variable initialization code seems to be backpatched anyways, this should be a rather easy optimization to implement, right?

Edit: By the way, static variables can be used instead if you don't use recursion.
technicorn
Enthusiast
Enthusiast
Posts: 105
Joined: Wed Jan 18, 2006 7:40 pm
Location: Hamburg

Post by technicorn »

Edit: By the way, static variables can be used instead if you don't use recursion.
And you don't plan on using the procedure with threads ;)
Post Reply