News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Short global variables

Started by jj2007, July 23, 2012, 07:40:27 AM

Previous topic - Next topic

jj2007

Quote from: qWord on July 23, 2012, 10:42:22 PM
Quote from: Ryan on July 23, 2012, 10:25:33 PM
Just out of curiosity, what file system/cluster size do you use?
He has create his own FS that allows a cluster size of 1 Byte - the days of oversized and byte wasting clusters are over  :biggrin:
Quote from: Ryan on July 23, 2012, 10:45:51 PM
Nice!  His file system uses a cluster size of 1/512 of a sector!

Hutch,

Could you please move these posts to their proper place? Afterwards, please delete this one (by the way: the old forum used to have a delete button - where is it gone?)

Thanks.

hutch--

No need, the Workshop is a place for general discussion and many topics wander from their original subject.

Ryan

My apologies.  I was trying to get a feeling for pros and cons.  I got a bit carried away.  I'm sorry.

Antariy

Jochen, it's cute technique simplifying the code readability, besides it could have its use, for instance, in an inner loops of some heavy multithreaded apps (for accessing global vars controlling the threads each from another) :t

jj2007

Quote from: Antariy on July 24, 2012, 12:29:28 PM
Jochen, it's cute technique simplifying the code readability, besides it could have its use, for instance, in an inner loops of some heavy multithreaded apps (for accessing global vars controlling the threads each from another) :t

Thanks, Alex, that could indeed be the most interesting application for this technique.

@Ryan: Thanks for the clarification :icon14:

dedndave

it can do a lot for you

if you look at the structures i posted earlier, you will see that i have horz and vert scroll info structs
i use the same code for both axis
at the beginning, i just grab a pointer into the structure
if it is horz scroll, the scroll info struct is right there
if it is vert scroll, i add the struct size and - bang - i am pointing at vert scroll info
then - both use the same code

again - with the handles...
when the child windows and controls are created in a loop, the handles fill the structure
in WM_SIZE, i use an index into the handle struct to adjust window/control sizes and positions

so - it saves more than a few bytes   :t

Gunther

Quote from: dedndave on July 25, 2012, 08:04:39 AM
so - it saves more than a few bytes   :t

Dave,

good point and a really cool technique. :t

Gunther
You have to know the facts before you can distort them.