BinaryByter
every byte of ram above 16k*
BinaryByter
below 16k, you might have some memory mapped
BinaryByter
also, above 16k you might have some broken memory or some mapped devices too
Mihail
also, in some scenarios you might want the array to start at pointer n, but you don't know how long it will be
Well if you want something like that you should really have re implemented a vector-like container
BinaryByter
really, you should check every memory adress at start before using them
BinaryByter
Well if you want something like that you should really have re implemented a vector-like container
adds bloat for something this simple. but int* a[1]; is good enough
MᏫᎻᎯᎷᎷᎬᎠ
in kernel dev, every byte of ram is yours to have
Like The whole main memory above 16k is yours You can do whatever you like with it?!
MᏫᎻᎯᎷᎷᎬᎠ
Lol
MᏫᎻᎯᎷᎷᎬᎠ
That's great
MᏫᎻᎯᎷᎷᎬᎠ
Then
BinaryByter
do you think that allocation is done by hardware?
BinaryByter
it is facilitated by it (MMU and stuff), but its not done by it
MᏫᎻᎯᎷᎷᎬᎠ
Then How the runtime memory model is structured?!
BinaryByter
runtime memory model can be absolutely anything
BinaryByter
use a better word please
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
C11 only
Daniele°
C11 only
C99 in C11 is downgrade to optional feature
Stanislav
C11 only
vla appeared in С99 :)
BinaryByter
my bad then
BinaryByter
sorry 😂
Daniele°
Is very unsafe feature
BinaryByter
depends on where you use it
BinaryByter
but i agree with you
Mihail
VLA is in std
It's not
BinaryByter
Mihail
In standard C++
Mihail
Mihail
Well yeah
Dima
Lol.
Dima
I wonder why would you need vla nowadays in C
BinaryByter
toldya :D
BinaryByter
just read
BinaryByter
lol
Dima
Ikr, but nevermind
Dima
C++ is stronger in typing
auto or void* :troll:
BinaryByter
auto or void* :troll:
void* a = my_malloc(100); will not compile if my_malloc returns int*
Dima
Cast to (void* )
Dima
Dima
#define myMalloc
BinaryByter
Cast to (void* )
Yes, but it goes against what you said
Dima
*Ugliness intensified*
Daniele°
#define NEW(T) (T*)malloc(sizeof(T)) ... ... int* i = NEW(int);
Dima
Lol I wanted to post exactly the same sticker
Daniele°
#define MANY(T,S) (T*)malloc(sizeof(T)*(S)) ... ... int* i = MANY(int,10);
Dima
I saw talkings about alloca Is there difference between ::alloca or char buffer[const size]; ... = new (buffet) Obj; ?
BinaryByter
buffet? 😂
Mihail
Mihail
Me like
BinaryByter
I like food too :D
Mihail
#define MANY(T,S) (T*)malloc(sizeof(T)*(S)) ... ... int* i = MANY(int,10);
I feel like I'm loosing brain cells faster than ever
Daniele°
where do you think the new() of C++ was born?
Daniele°
😂
Mihail
where do you think the new() of C++ was born?
Most definitely not in an ugly preprocessor thing
Dima
buffet? 😂
s/buffet/buffer
Dima
Soo..
Dima
BinaryByter
Right
BinaryByter
C is a superset of a macro assembler
Daniele°
Most definitely not in an ugly preprocessor thing
The most C++ is take from preprocessor C
Mihail
The most C++ is take from preprocessor C
This must be some sort of joke, right?
Mihail
yes
Ok good
BinaryByter
someone recently claimed it here
Mihail
Got scared for a second