diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-07-18 15:15:51 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-07-18 15:15:51 +0400 |
commit | c5b1a133c054c785c812b0ff62d4166b0fc5b126 (patch) | |
tree | d9d0bbcd153feb8bd72bfcd1a4ada4299462e624 /winsup/cygwin/cygheap.cc | |
parent | 52a6e6d8c7466fe78ab755ae2895dfc0948e401d (diff) |
* 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\\" : ""); } |