I just noticed that having access to a memory region (mprotect) can be interpreted as having a resource.

Following the principle, that resource can be encapsulated in an object that automatically unlocks the memory when constructed and locks it again when destructed.

Sign in to participate in the conversation

Generalistic and moderated instance.