Re: Q: Unlock resources (How to?)
From: Severian (severian_at_chlamydia-is-not-a-flower.com)
Date: 02/16/05
- Next message: news_at_rtrussell.co.uk: "Re: icon"
- Previous message: Severian: "Re: Problem preserving alpha in 32 bits bitmap"
- In reply to: johndoe1: "Q: Unlock resources (How to?)"
- Next in thread: Ken Wickes [MSFT]: "Re: Q: Unlock resources (How to?)"
- Reply: Ken Wickes [MSFT]: "Re: Q: Unlock resources (How to?)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Feb 2005 13:28:03 GMT
On Mon, 07 Feb 2005 12:29:44 -0500, johndoe1 <blam@blam.com> wrote:
>Friends,
>
>I wonder if you could enlighten me on this: it used to be possible to load
>a resource, lock it, use it, and then happily unload -- maybe repeating
>the procedure in a loop many times -- not holding in memory the stuff you
>no longer need in there. Now, I'm reading the docs and it says that
>UnlockResource is deprecated and "It is not necessary to unlock resources
>because the system automatically deletes them when the process that
>created them terminates". What kind of crap is that? I want to get rid of
>the stuff that I've used and am through with, and I'm going to load and
>use a lot or resources and they're not of a trivial size. And I'm not
>terminating right after their use, I've got a lot of other things to do.
>
>So, how do I get rid of loaded resources?
>
>Here's a scenario: say, I have 20 resources (custom, binary, not fonts or
>dialogs). I want to load them in sequence, one at a time, use them, and
>then go to the next one in a loop. But if I don't unload stuff and keep it
>all locked in memory, that seems like it's no good no? I suppose that a
>"loaded" resouce may be swapped out, but the "locked" can't, right? So I
>don't need them locked forever.
>
>Any suggestions?
As I understand it, resources are part of the mapped EXE (or DLL) and
will be paged out when not in use. Since they are read-only parts of
the executable, they do not consume page file space.
Locking them does not force them to remain in main memory.
-- Sev
- Next message: news_at_rtrussell.co.uk: "Re: icon"
- Previous message: Severian: "Re: Problem preserving alpha in 32 bits bitmap"
- In reply to: johndoe1: "Q: Unlock resources (How to?)"
- Next in thread: Ken Wickes [MSFT]: "Re: Q: Unlock resources (How to?)"
- Reply: Ken Wickes [MSFT]: "Re: Q: Unlock resources (How to?)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|