←back to thread

1371 points yett | 1 comments | | HN request time: 0.214s | source
Show context
db48x ◴[] No.43772686[source]
[flagged]
replies(8): >>43772700 #>>43772801 #>>43772908 #>>43773054 #>>43773261 #>>43774132 #>>43774982 #>>43777757 #
mschuster91 ◴[] No.43772801[source]
To u/db48x whose post got flagged and doesn't reappear despite me vouching for it as I think they have a point (at least for modern games): GTA San Andreas was released in 2004. Back then, YAML was in its infancy (2001) and JSON was only standardized informally in 2006, and XML wasn't something widely used outside of the Java world.

On top of that, the hardware requirements (256MB of system RAM, and the PlayStation 2 only had 32MB) made it enough of a challenge to get the game running at all. Throwing in a heavyweight parsing library for either of these three languages was out of the question.

replies(11): >>43772845 #>>43772895 #>>43773040 #>>43773086 #>>43773123 #>>43773186 #>>43773306 #>>43773332 #>>43773461 #>>43774704 #>>43775548 #
db48x ◴[] No.43773306[source]
You’re not entirely wrong, but a library doesn’t have to be “heavyweight” in order to be bulletproof. And you can load the library during startup and then unload it after; it doesn’t have to stick around for the whole run time of the game. Modern OSes will reclaim the pages after you stop using them, if there is memory pressure. Of course the PS2 didn’t do that I am sure.
replies(1): >>43773412 #
rfoo ◴[] No.43773412[source]
Meanwhile, in a certain modern OS, unloading a library is too broken to the point that people are discouraged to do so... Try to unload GLib [0] from your process :p

[0] https://docs.gtk.org/glib/

replies(1): >>43775486 #
1. wat10000 ◴[] No.43775486[source]
Unloading C libraries is fundamentally fraught with peril. It's incredibly difficult to ensure that no dangling pointers to the library remain when it's unloaded. It's really fun to debug, too. The code responsible for the crash literally is not present in the process at the time of the crash!