Conversation
Notices
-
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Sunday, 31-Dec-2023 19:26:12 JST Pleroma-tan int
main(void)
{
int *n = malloc(sizeof(int));
*n = 4;
*n *= 2;
*n -= 3;
*n += 4;
return 0;
} // this shit leaks memory-
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Sunday, 31-Dec-2023 19:31:42 JST Pleroma-tan cc @meso this one will compile -
Embed this notice
valium (diazepam@clubcyberia.co)'s status on Sunday, 31-Dec-2023 19:54:25 JST valium @kirby you know you can just do
#include <stdlib.h> static void free_(void** p) { free(*p); } int main(void) { __attribute__((cleanup(free_))) int* n = malloc(sizeof *n); // do rest of your shit }and get it autofreed
Pleroma-tan likes this. -
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Sunday, 31-Dec-2023 19:56:28 JST Pleroma-tan @diazepam :0171: -
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Sunday, 31-Dec-2023 20:17:37 JST Pleroma-tan @Inginsub do modern unixes have their kernels go out of their way to do that wtf -
Embed this notice
:ihavenomouth: (inginsub@clubcyberia.co)'s status on Sunday, 31-Dec-2023 20:17:38 JST :ihavenomouth: @kirby not really, the memory is freed automatically when the program exits Pleroma-tan likes this. -
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Sunday, 31-Dec-2023 20:19:34 JST Pleroma-tan @Inginsub I mean it makes sense but at the same time I was taught to put away my food like a good boy -
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Sunday, 31-Dec-2023 20:20:26 JST Pleroma-tan @Inginsub free my memory cough -
Embed this notice
:ihavenomouth: (inginsub@clubcyberia.co)'s status on Sunday, 31-Dec-2023 20:22:59 JST :ihavenomouth: @kirby most general purpose operating systems with memory management do. if you find yourself in real time land, you may not have such luxuries, but you would want to avoid memory allocation whenever possible too Pleroma-tan likes this. -
Embed this notice
:ihavenomouth: (inginsub@clubcyberia.co)'s status on Sunday, 31-Dec-2023 20:23:34 JST :ihavenomouth: @kirby it is a good habit to have Pleroma-tan likes this.
-
Embed this notice