←back to thread

217 points varbhat | 1 comments | | HN request time: 0.231s | source
Show context
majke ◴[] No.44374247[source]
About structs:

https://docs.rs/subsecond/0.7.0-alpha.1/subsecond/index.html...

  "In practice, frameworks that implement subsecond patching properly will throw out the old state and thus you should never witness a segfault due to misalignment or size changes. Frameworks are encouraged to aggressively dispose of old state that might cause size and alignment changes."
I don't think "throwing out the old state" is a sensible recommendation. "re-instancing" is called "update/upgrade/downgede of internal state" in OTP:

https://www.erlang.org/docs/24/man/gen_server#Module:code_ch...

Perhaps I'm missing something, maybe subsecond is a good tool for toy apps or for a developer workflow. But for anything serious, I'd think that managing layout of structs is a primary concern.

replies(2): >>44374421 #>>44374575 #
1. conradludgate ◴[] No.44374575[source]
> Subsecond is only enabled when debug_assertions are enabled so you can safely ship your application with Subsecond enabled without worrying about the performance overhead.

debug_assertions is usually only enabled in the development phase (release build default to debug_assertions=false), so yes this is not intended for production workloads