diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-07-18 11:15:51 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-07-18 11:15:51 +0000 |
commit | c5b1a133c054c785c812b0ff62d4166b0fc5b126 (patch) | |
tree | d9d0bbcd153feb8bd72bfcd1a4ada4299462e624 /winsup/cygwin/cygheap.cc | |
parent | 52a6e6d8c7466fe78ab755ae2895dfc0948e401d (diff) | |
download | cygnal-c5b1a133c054c785c812b0ff62d4166b0fc5b126.tar.gz cygnal-c5b1a133c054c785c812b0ff62d4166b0fc5b126.tar.bz2 cygnal-c5b1a133c054c785c812b0ff62d4166b0fc5b126.zip |
* cygheap.h (shared_prefix): De-const.
(shared_prefix_buf): Add static buffer for shared prefix to avoid
additional allocation.
* cygheap.cc (cygheap_init): Set cygheap->shared_prefix to
cygheap->shared_prefix_buf and strcpy.
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r-- | winsup/cygwin/cygheap.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index 2c937fc7c..3b4b72ba7 100644 --- a/winsup/cygwin/cygheap.cc +++ b/winsup/cygwin/cygheap.cc @@ -163,8 +163,10 @@ cygheap_init () if (!cygheap->sigs) sigalloc (); + /* Should this ever change, keep in mind that shared_prefix_buf is exactly + 8 bytes long, just enough to match the size of the "Global\\" string. */ if (!cygheap->shared_prefix) - cygheap->shared_prefix = cstrdup ( + strcpy (cygheap->shared_prefix = cygheap->shared_prefix_buf, wincap.has_terminal_services () ? "Global\\" : ""); } |