logs archiveBotHelp.net / Freenode / #2f30 / 2015 / August / 13 / 5
stateless
for example an array of 64 4-byte ints
sorry that's wrong
an array of 8 ints 4-byte ints
so that will consume less space than 200 bools
32 instead of 200 bytes
then make set/clr funcs
where the index is in the range [0, 255]
atmc
hm that makes sense
i could also assign variables to the indices
stateless
yeah a hash define
:P
k0ga
FRIGN: I have added a "Hello world" test ;)
retard
bool is really silly
int or bitfield master race
atmc
hm
bool also needs to get promoted right?
because its < system precision
k0ga
all the operations are done in integers
excep in long or long long of course
atmc
yea so if bool is 8bits
its < 32bits
or bit
k0ga
atmc: it can be
atmc
then it uses additional assembler code
i check that wait
k0ga
usually is 8 bits in all the platforms
but you can take the decision of make it 32 bits
atmc
so bool makes no sense to have? :D
retard
nope
k0ga
I know at least one compiler for one platform that uses flags of the procesor to implement bool in the refturn type of functions
stateless
lol nice
atmc
k0ga: it seems on linux gcc 64bit the usage of bool and int is equivalent in asm operations
returning a bool vs an int is the produces the same code
k0ga
atmc: in functions is easier to assing 0 or 1 to the full register
try to store the value returned in a variable and you will the differences
atmc
yes
-O3 for example
uses
movl $1, %eax
for bool
and xorl %eax, %eax
which at least show a difference
oh
its becuase
one returns 0
the other one true
:)
k0ga
stateless: in z80 is very convenient that bool sets the Z flag
so you can do something like:
call fun1
jr z,label
FRIGN
k0ga: bool is just ugly
and using a bitmap doesn't save memory
actually, the compiler can optimize int better
k0ga
FRIGN: I don't like it, but I understand that in some machines it can be helpful
I have posted the code in z80 where it can help a lot
FRIGN
k0ga: in the end, your program spends most time with I/O
stateless
FRIGN, using a bitmap will save memory
FRIGN
stateless: not always
stateless
FRIGN, in what situation will it not?
k0ga
when you use only 1 bit
:P
FRIGN
when it comes to alignment
stateless
k0ga, but that's what I am saying
FRIGN, that is irrelevant
FRIGN
It's not my area
dude, let me check
sec
k0ga
stateless: I was thinking to use a bitmap for the tab possition in st
but I realized that the code to have it will be bigger than the memory saved in the data structure
stateless
int flags[100]; is 400 bytes, in flags[4] can store 128 bits
the latter can be used as flags
k0ga, yes
you need set/clr/test funcs or similar
FRIGN, for example FD_* is a bitmap in select()
usually
:)
k0ga
in the case of st was an array with the same size of the width of the terminal
it usually is value between 80 and 200
bytes
the functions to handle it can be bigger of 100 bytes perfectly
FRIGN
stateless: It makes sense for many states
stateless
FRIGN, I think you are referring to bitfields
not bitmaps
FRIGN
If you have a struct keeping many bools
oh seheeeeet
sorry
stateless
:P
in which case you are right
FRIGN
lol
stateless
:P
FRIGN
haha, sorry man ^^
I didn't drink though
stateless
:D
Evil_Bob
k0ga: one thing i dont like about st is it doesnt copy tabs when selecting them :P
stateless
yeah that's annoying :P
retard
i hate waiting for bank transfers
FRIGN
retard: said no greek ever
:P
retard
but i'm not a wop
« prev 1 2 3 4 5 6 next »