Post AW6SyGSZkGRhYlvFdg by natanbc@uwu.social
 (DIR) More posts by natanbc@uwu.social
 (DIR) Post #AW4fMbzk8mOWQutP4S by niconiconi@mk.absturztau.be
       2023-05-27T08:12:18.749Z
       
       3 likes, 0 repeats
       
       It's a little known fact that all Unix-like systems provide a powerful dynamic memory management primitive directly in the kernel: "segmentation fault"... Want dynamically-sized arrays? Optimized garbage collection? NUMA-aware memory access policy? mprotect(), then trap on SIGSEGV. ​:woozy_baa:​
       
 (DIR) Post #AW4g3pQI5gReX2uvtA by lanodan@queer.hacktivis.me
       2023-05-27T08:18:01.816847Z
       
       0 likes, 0 repeats
       
       @niconiconi Ah yes, gdb
       
 (DIR) Post #AW4gNdkzAueg8q2ndQ by ivesen@miniwa.moe
       2023-05-27T08:23:41.414157Z
       
       0 likes, 0 repeats
       
       @niconiconi some oldschool gamedev was talking about writing a C compiler where the memory management involved one big tree structure that automatically allocates more memory when you write out of bounds :blabcat:
       
 (DIR) Post #AW4gR67OBVjMyIAiGW by niconiconi@mk.absturztau.be
       2023-05-27T08:24:19.577Z
       
       1 likes, 0 repeats
       
       @lanodan@queer.hacktivis.me The original Bourne Shell traps on SIGSEGV to know when to increase its memory pool size... Apparently it remains a standard technique in many GC engine and interpreters... ​:woozy_baa:​
       
 (DIR) Post #AW4gXvcXc2zMRP0436 by icedquinn@blob.cat
       2023-05-27T08:25:33.857373Z
       
       0 likes, 0 repeats
       
       @niconiconi @lanodan cooperative memory use is why at one point i said the GC should be a system service :blobcatpain:
       
 (DIR) Post #AW4gbVKTJ0RY3eFlho by niconiconi@mk.absturztau.be
       2023-05-27T08:26:12.515Z
       
       1 likes, 0 repeats
       
       @ivesen@miniwa.moe The original Bourne Shell worked like that. If SIGSEGV happens, it allocates more memory. People found /bin/sh was an useful stress test for new Unix ports - if it runs okay, you know your MMU code is working... ​:woozy_baa:​
       
 (DIR) Post #AW4gdVYxPLi1MTz5V2 by lanodan@queer.hacktivis.me
       2023-05-27T08:25:37.402202Z
       
       0 likes, 0 repeats
       
       @niconiconi Bourne Shell is the hacked up software that keeps on giving curses
       
 (DIR) Post #AW4ghOTdh7eYXmLkAa by chjara@snowdin.town
       2023-05-27T08:27:02.035249Z
       
       1 likes, 0 repeats
       
       @niconiconi i mean, yeah, that sounds jank but really it makes sense, why add excessive runtime overhead when the processor and system tells you when you go above your memory
       
 (DIR) Post #AW4gjOXUR0PbJd6ZO4 by ivesen@miniwa.moe
       2023-05-27T08:27:37.622480Z
       
       0 likes, 0 repeats
       
       @niconiconi honestly, seems like a nice solution if you only need 1 contiguous block of memory
       
 (DIR) Post #AW4gjeHltDLU9VsF6m by lanodan@queer.hacktivis.me
       2023-05-27T08:27:10.530919Z
       
       0 likes, 0 repeats
       
       @icedquinn @niconiconi Would agree, cooperative in an OS typically means having a dedicated service managing the cooperation, otherwise you get chaos (as seen by how broken caches done in userspace is).
       
 (DIR) Post #AW4gne10pvIUTLwMPw by icedquinn@blob.cat
       2023-05-27T08:28:24.858947Z
       
       1 likes, 0 repeats
       
       @lanodan @niconiconi well when each process is cowboying memory, they don't realize someone else needs it and they don't so they should do a collection and give it back.one of the reasons i used to hate seeing GC programs
       
 (DIR) Post #AW4gpA7IyABSK5biHA by icedquinn@blob.cat
       2023-05-27T08:28:42.031809Z
       
       0 likes, 0 repeats
       
       @lanodan @niconiconi but then i'm a dofus who tried to arena allocate a web server so :ablobcatgooglytenor:
       
 (DIR) Post #AW4gtdreJKqLk2Q8TA by icedquinn@blob.cat
       2023-05-27T08:29:30.659152Z
       
       1 likes, 0 repeats
       
       @lanodan @niconiconi i liked the sick burn that was like "i don't know what the syntax for bourne shell is but for RC there is just a parser file"
       
 (DIR) Post #AW4hHmgl9ack3lq4pc by lanodan@queer.hacktivis.me
       2023-05-27T08:31:46.344769Z
       
       0 likes, 0 repeats
       
       @icedquinn @niconiconi Heh yeah, wouldn't be surprised that no one knows the syntax of the original bourne shell anymore.
       
 (DIR) Post #AW6SyGSZkGRhYlvFdg by natanbc@uwu.social
       2023-05-27T21:03:06Z
       
       1 likes, 0 repeats
       
       @niconiconi openjdk uses that trick for null check ellision[1] and safepoint polls[2][1]: https://shipilev.net/jvm/anatomy-quarks/25-implicit-null-checks/[2]: https://shipilev.net/jvm/anatomy-quarks/22-safepoint-polls/