Time |
Nick |
Message |
00:03 |
|
garywhite joined #minetest |
00:03 |
|
garywhite joined #minetest |
00:17 |
|
Hawk777 joined #minetest |
00:45 |
|
AliasAlreadyTake joined #minetest |
00:48 |
|
macaw joined #minetest |
00:49 |
|
illwieckz joined #minetest |
00:56 |
|
Verticen joined #minetest |
01:34 |
|
sparky4 joined #minetest |
02:16 |
|
Extex joined #minetest |
02:19 |
|
Extex joined #minetest |
02:24 |
|
Extex joined #minetest |
02:36 |
|
Extex joined #minetest |
02:52 |
|
Sven_vB joined #minetest |
03:28 |
|
queria joined #minetest |
03:34 |
|
queria joined #minetest |
04:11 |
|
Alias joined #minetest |
04:34 |
|
Verticen joined #minetest |
05:00 |
|
MTDiscord joined #minetest |
05:07 |
|
sagax joined #minetest |
06:01 |
|
riff-IRC joined #minetest |
06:20 |
|
plainoldcheese joined #minetest |
06:57 |
|
plainoldcheese joined #minetest |
06:59 |
|
rubenwardy joined #minetest |
06:59 |
|
Chompy joined #minetest |
06:59 |
|
beanzilla joined #minetest |
07:02 |
|
Fulgen joined #minetest |
07:04 |
|
Shara joined #minetest |
07:04 |
|
ShadowNinja joined #minetest |
07:04 |
|
jfred joined #minetest |
07:04 |
|
ghoti joined #minetest |
07:04 |
|
Shara joined #minetest |
07:25 |
|
TomTom joined #minetest |
07:34 |
|
sagax joined #minetest |
07:56 |
|
CWz joined #minetest |
08:24 |
|
specing_ joined #minetest |
08:44 |
|
olliy joined #minetest |
09:04 |
|
wing joined #minetest |
11:22 |
|
AristotIe joined #minetest |
11:25 |
|
calcul0n__ joined #minetest |
11:29 |
|
lumidify joined #minetest |
11:33 |
|
tech_exorcist joined #minetest |
11:50 |
|
definitelya joined #minetest |
12:21 |
|
proller joined #minetest |
13:02 |
|
GNUHacker joined #minetest |
13:20 |
|
grouinos joined #minetest |
13:44 |
|
proller joined #minetest |
13:58 |
|
kamdard_ joined #minetest |
14:01 |
|
Toothless55 joined #minetest |
14:08 |
|
wing joined #minetest |
14:10 |
|
ggITA52_ joined #minetest |
14:15 |
|
Alias joined #minetest |
14:22 |
|
proller joined #minetest |
14:48 |
|
ggITA52_ joined #minetest |
14:54 |
|
grouinos joined #minetest |
15:13 |
|
tech_exorcist joined #minetest |
15:37 |
|
Guest243 joined #minetest |
15:54 |
|
Extex joined #minetest |
15:58 |
|
macaw joined #minetest |
16:16 |
|
Extex joined #minetest |
16:22 |
|
Fixer joined #minetest |
16:28 |
|
Hawk777 joined #minetest |
16:39 |
|
appguru joined #minetest |
16:44 |
|
proller joined #minetest |
16:59 |
|
erlehmann joined #minetest |
17:14 |
|
garywhite joined #minetest |
17:14 |
|
garywhite joined #minetest |
17:17 |
|
delta23 joined #minetest |
17:21 |
|
Toothless5 joined #minetest |
17:34 |
|
Extex joined #minetest |
17:49 |
|
Talkless joined #minetest |
18:15 |
|
Verticen joined #minetest |
18:26 |
|
macaw joined #minetest |
18:54 |
|
proller joined #minetest |
18:58 |
|
fluxionary joined #minetest |
19:11 |
|
Toothless20 joined #minetest |
19:22 |
|
sys4 joined #minetest |
19:58 |
|
Extex joined #minetest |
20:25 |
|
specing joined #minetest |
20:28 |
|
sys4 joined #minetest |
21:08 |
|
proller joined #minetest |
21:31 |
erlehmann |
<sfan5> how would new[] know how many objects are in the array? |
21:31 |
erlehmann |
well i thought i do “char *p = new char[10];” and the magic happens |
21:31 |
sfan5 |
did you even read the documentation I linked? |
21:31 |
sfan5 |
just the function signature would be enough |
21:32 |
sfan5 |
void* operator new ( std::size_t count ); |
21:32 |
sfan5 |
void* operator new[]( std::size_t count ); |
21:32 |
erlehmann |
ok |
21:32 |
erlehmann |
what do the [] then mean if not syntactic sugar? |
21:33 |
sfan5 |
grossly simplified the line you pasted is equivalent to "char *p = operator new[](sizeof(char) * 10);" |
21:34 |
sfan5 |
where operator new[] is just a weirdly named function |
21:34 |
erlehmann |
ok |
21:34 |
sfan5 |
worth pointing out that initialization of the objects does not happen inside operator new[] |
21:37 |
erlehmann |
i have to look into this more to understand it |
21:48 |
erlehmann |
i rest |
21:48 |
GNUHacker |
any optifine's like shaders 4 minetest? |
22:15 |
|
macaw joined #minetest |
22:19 |
|
YuGiOhJCJ joined #minetest |
22:21 |
erlehmann |
sfan5, before going to sleep: my understanding is that confusing delete and delete[] may result in heap corruption depending on whateve the implementation does behind the curtainr. i will hive to use a debugger. |
22:21 |
erlehmann |
curtain |
22:21 |
sfan5 |
it may result in anything |
22:21 |
Hawk777 |
It can also result in destructors only being run on the first object in the array, even if the heap is actually kept intact; that is another possible outcome. Of course it’s UB so really anything can happen. |
22:21 |
erlehmann |
uh |
22:22 |
erlehmann |
if it's UB, then i definitely should stop looking how it's implemented |
22:22 |
erlehmann |
as that doesn't help me understanding a thing |
22:23 |
erlehmann |
thanks, both of you |
22:23 |
Hawk777 |
“In the first alternative (delete object), the value of the operand of delete may be a null pointer value, a pointer to a ***non-array*** object created by a previous new-expression, or a pointer to a subobject (4.5) representing a base class of such an object (Clause 13). If not, the behavior is undefined.” so yeah, UB. |
22:24 |
Hawk777 |
The next sentence says the same about the converse (delete[] must be used only on things made by new[]). |
22:37 |
|
Verticen joined #minetest |
23:00 |
|
Sven_vB joined #minetest |