diff options
| author | Geoff Voelker | 1997-07-01 05:05:45 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1997-07-01 05:05:45 +0000 |
| commit | e54c8cd1194ff791d17c7932a6080dda0838d7c8 (patch) | |
| tree | 6e489f21c4c7b6057bc50a208c7faf40e0e01784 /src | |
| parent | 333c25a99b7ebc65d98189e2a9f1e6a3ccecbec3 (diff) | |
| download | emacs-e54c8cd1194ff791d17c7932a6080dda0838d7c8.tar.gz emacs-e54c8cd1194ff791d17c7932a6080dda0838d7c8.zip | |
Add pragma to force zero initialized
data into .data segment.
Diffstat (limited to 'src')
| -rw-r--r-- | src/unexw32.c | 4 | ||||
| -rw-r--r-- | src/w32heap.c | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/unexw32.c b/src/unexw32.c index d449a79eaa0..ef4ed56fb9f 100644 --- a/src/unexw32.c +++ b/src/unexw32.c | |||
| @@ -39,6 +39,10 @@ typedef struct file_data { | |||
| 39 | unsigned char *file_base; | 39 | unsigned char *file_base; |
| 40 | } file_data; | 40 | } file_data; |
| 41 | 41 | ||
| 42 | /* Force zero initialized variables to be placed in the .data segment; | ||
| 43 | MSVC 5.0 otherwise places them in .bss, which breaks the dumping code. */ | ||
| 44 | #pragma data_seg(".data") | ||
| 45 | |||
| 42 | /* Basically, our "initialized" flag. */ | 46 | /* Basically, our "initialized" flag. */ |
| 43 | BOOL need_to_recreate_heap = FALSE; | 47 | BOOL need_to_recreate_heap = FALSE; |
| 44 | 48 | ||
diff --git a/src/w32heap.c b/src/w32heap.c index 2a92d059d90..8565999b459 100644 --- a/src/w32heap.c +++ b/src/w32heap.c | |||
| @@ -66,6 +66,13 @@ cache_system_info (void) | |||
| 66 | syspage_mask = sysinfo_cache.dwPageSize - 1; | 66 | syspage_mask = sysinfo_cache.dwPageSize - 1; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | /* Emulate getpagesize. */ | ||
| 70 | int | ||
| 71 | getpagesize (void) | ||
| 72 | { | ||
| 73 | return sysinfo_cache.dwPageSize; | ||
| 74 | } | ||
| 75 | |||
| 69 | /* Round ADDRESS up to be aligned with ALIGN. */ | 76 | /* Round ADDRESS up to be aligned with ALIGN. */ |
| 70 | unsigned char * | 77 | unsigned char * |
| 71 | round_to_next (unsigned char *address, unsigned long align) | 78 | round_to_next (unsigned char *address, unsigned long align) |
| @@ -78,6 +85,10 @@ round_to_next (unsigned char *address, unsigned long align) | |||
| 78 | return (unsigned char *) (tmp * align); | 85 | return (unsigned char *) (tmp * align); |
| 79 | } | 86 | } |
| 80 | 87 | ||
| 88 | /* Force zero initialized variables to be placed in the .data segment; | ||
| 89 | MSVC 5.0 otherwise places them in .bss, which breaks the dumping code. */ | ||
| 90 | #pragma data_seg(".data") | ||
| 91 | |||
| 81 | /* Info for keeping track of our heap. */ | 92 | /* Info for keeping track of our heap. */ |
| 82 | unsigned char *data_region_base = NULL; | 93 | unsigned char *data_region_base = NULL; |
| 83 | unsigned char *data_region_end = NULL; | 94 | unsigned char *data_region_end = NULL; |