Don't substitute sigprocmask for pthread_sigmask.
[bpt/emacs.git] / src / w32heap.h
CommitLineData
95ed0025 1/* Heap management routines (including unexec) for GNU Emacs on Windows NT.
ba318903 2 Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc.
95ed0025 3
3b7ad313
EN
4This file is part of GNU Emacs.
5
b9b1cc14 6GNU Emacs is free software: you can redistribute it and/or modify
3b7ad313 7it under the terms of the GNU General Public License as published by
b9b1cc14
GM
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
3b7ad313
EN
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
ebff94f0 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
95ed0025
RS
18
19 Geoff Voelker (voelker@cs.washington.edu) 7-29-94
20*/
21
22#ifndef NTHEAP_H_
23#define NTHEAP_H_
24
25#include <windows.h>
26
27/*
28 * Heap related stuff.
29 */
587fd086
FP
30
31#define DUMPED_HEAP_SIZE (HEAPSIZE*1024*1024)
32
33extern unsigned char dumped_data[];
95ed0025 34
361358ea
JB
35extern unsigned char *get_data_start (void);
36extern unsigned char *get_data_end (void);
62aba0d4 37extern size_t reserved_heap_size;
587fd086
FP
38extern BOOL using_dynamic_heap;
39
40extern void *mmap_realloc (void **, size_t);
41extern void mmap_free (void **);
42extern void *mmap_alloc (void **, size_t);
43
3443b04a 44
95ed0025 45/* Emulation of Unix sbrk(). */
62aba0d4 46extern void *sbrk (ptrdiff_t size);
95ed0025 47
a5352d98 48/* Initialize heap structures for sbrk on startup. */
361358ea 49extern void init_heap (void);
95ed0025 50
3443b04a 51/* ----------------------------------------------------------------- */
587fd086 52/* Useful routines for manipulating memory-mapped files. */
3443b04a
GV
53
54typedef struct file_data {
55 char *name;
56 unsigned long size;
57 HANDLE file;
58 HANDLE file_mapping;
59 unsigned char *file_base;
60} file_data;
61
3443b04a
GV
62int open_input_file (file_data *p_file, char *name);
63int open_output_file (file_data *p_file, char *name, unsigned long size);
64void close_file_data (file_data *p_file);
65
587fd086 66/* Return pointer to section header for named section. */
3443b04a
GV
67IMAGE_SECTION_HEADER * find_section (char * name, IMAGE_NT_HEADERS * nt_header);
68
69/* Return pointer to section header for section containing the given
587fd086 70 relative virtual address. */
62aba0d4 71IMAGE_SECTION_HEADER * rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header);
3443b04a 72
95ed0025 73#endif /* NTHEAP_H_ */