Skip site navigation (1) Skip section navigation (2)

Re: Win32: Minimising desktop heap usage

From: Dave Page <dpage(at)postgresql(dot)org>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Win32: Minimising desktop heap usage
Date: 2007-10-23 16:15:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Gregory Stark wrote:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>>> !     /*
>>> !      * Note: We use getenv here because the more modern SHGetSpecialFolderPath()
>>> !      * will force us to link with shell32.lib which eats valuable desktop heap.
>>> !      */
>>> !     tmppath = getenv("APPDATA");
>> Hmm, is there any functional downside to this?  I suppose
>> SHGetSpecialFolderPath does some things that getenv does not...
> The functional difference appears to be that the environment variable is set
> on startup (or login?) and doesn't necessarily have the most up to date value
> if it's been changed. But it's not something you're likely to change and you
> can always adjust the environment variable manually to fix the problem.

If you're hacking the registry to change it then you've only got
yourself to blame if you don't update the environment as well imho.

I also wouldn't be at all surprised if many apps build paths containing
the value returned by SHGetSpecialFolderPath() (or %APPDATA%) at startup
and then use that value from then on rather than repeatedly calling the
API function. It's not like you'd expect the value to change at all
often, if ever.


In response to

pgsql-patches by date

Next:From: Heikki LinnakangasDate: 2007-10-23 16:28:36
Subject: uuid.h on Debian
Previous:From: Dave PageDate: 2007-10-23 16:09:42
Subject: Re: Win32: Minimising desktop heap usage

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group