triton-windows 3.3.0a0.post12__cp310-cp310-win_amd64.whl → 3.3.0a0.post13__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of triton-windows might be problematic. Click here for more details.
- triton/_C/libtriton.pyd +0 -0
- triton/__init__.py +0 -12
- triton/backends/nvidia/compiler.py +3 -1
- triton/compiler/compiler.py +4 -4
- triton/runtime/build.py +29 -10
- triton/runtime/tcc/include/_mingw.h +170 -0
- triton/runtime/tcc/include/assert.h +57 -0
- triton/runtime/tcc/include/conio.h +409 -0
- triton/runtime/tcc/include/ctype.h +281 -0
- triton/runtime/tcc/include/dir.h +31 -0
- triton/runtime/tcc/include/direct.h +68 -0
- triton/runtime/tcc/include/dirent.h +135 -0
- triton/runtime/tcc/include/dos.h +55 -0
- triton/runtime/tcc/include/errno.h +75 -0
- triton/runtime/tcc/include/excpt.h +123 -0
- triton/runtime/tcc/include/fcntl.h +52 -0
- triton/runtime/tcc/include/fenv.h +108 -0
- triton/runtime/tcc/include/float.h +57 -0
- triton/runtime/tcc/include/inttypes.h +297 -0
- triton/runtime/tcc/include/io.h +418 -0
- triton/runtime/tcc/include/limits.h +111 -0
- triton/runtime/tcc/include/locale.h +91 -0
- triton/runtime/tcc/include/malloc.h +181 -0
- triton/runtime/tcc/include/math.h +737 -0
- triton/runtime/tcc/include/mem.h +13 -0
- triton/runtime/tcc/include/memory.h +40 -0
- triton/runtime/tcc/include/process.h +176 -0
- triton/runtime/tcc/include/sec_api/conio_s.h +42 -0
- triton/runtime/tcc/include/sec_api/crtdbg_s.h +19 -0
- triton/runtime/tcc/include/sec_api/io_s.h +33 -0
- triton/runtime/tcc/include/sec_api/mbstring_s.h +52 -0
- triton/runtime/tcc/include/sec_api/search_s.h +25 -0
- triton/runtime/tcc/include/sec_api/stdio_s.h +145 -0
- triton/runtime/tcc/include/sec_api/stdlib_s.h +67 -0
- triton/runtime/tcc/include/sec_api/stralign_s.h +30 -0
- triton/runtime/tcc/include/sec_api/string_s.h +41 -0
- triton/runtime/tcc/include/sec_api/sys/timeb_s.h +34 -0
- triton/runtime/tcc/include/sec_api/tchar_s.h +266 -0
- triton/runtime/tcc/include/sec_api/time_s.h +61 -0
- triton/runtime/tcc/include/sec_api/wchar_s.h +128 -0
- triton/runtime/tcc/include/setjmp.h +160 -0
- triton/runtime/tcc/include/share.h +28 -0
- triton/runtime/tcc/include/signal.h +63 -0
- triton/runtime/tcc/include/stdarg.h +79 -0
- triton/runtime/tcc/include/stdbool.h +11 -0
- triton/runtime/tcc/include/stddef.h +54 -0
- triton/runtime/tcc/include/stdint.h +212 -0
- triton/runtime/tcc/include/stdio.h +429 -0
- triton/runtime/tcc/include/stdlib.h +580 -0
- triton/runtime/tcc/include/string.h +164 -0
- triton/runtime/tcc/include/sys/fcntl.h +13 -0
- triton/runtime/tcc/include/sys/file.h +14 -0
- triton/runtime/tcc/include/sys/locking.h +30 -0
- triton/runtime/tcc/include/sys/stat.h +290 -0
- triton/runtime/tcc/include/sys/time.h +69 -0
- triton/runtime/tcc/include/sys/timeb.h +133 -0
- triton/runtime/tcc/include/sys/types.h +118 -0
- triton/runtime/tcc/include/sys/unistd.h +14 -0
- triton/runtime/tcc/include/sys/utime.h +146 -0
- triton/runtime/tcc/include/tcc/tcc_libm.h +201 -0
- triton/runtime/tcc/include/tcclib.h +80 -0
- triton/runtime/tcc/include/tchar.h +1102 -0
- triton/runtime/tcc/include/time.h +287 -0
- triton/runtime/tcc/include/vadefs.h +11 -0
- triton/runtime/tcc/include/values.h +4 -0
- triton/runtime/tcc/include/varargs.h +12 -0
- triton/runtime/tcc/include/wchar.h +873 -0
- triton/runtime/tcc/include/wctype.h +172 -0
- triton/runtime/tcc/include/winapi/basetsd.h +149 -0
- triton/runtime/tcc/include/winapi/basetyps.h +85 -0
- triton/runtime/tcc/include/winapi/guiddef.h +156 -0
- triton/runtime/tcc/include/winapi/poppack.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack1.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack2.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack4.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack8.h +8 -0
- triton/runtime/tcc/include/winapi/winbase.h +2951 -0
- triton/runtime/tcc/include/winapi/wincon.h +301 -0
- triton/runtime/tcc/include/winapi/windef.h +293 -0
- triton/runtime/tcc/include/winapi/windows.h +127 -0
- triton/runtime/tcc/include/winapi/winerror.h +3166 -0
- triton/runtime/tcc/include/winapi/wingdi.h +4080 -0
- triton/runtime/tcc/include/winapi/winnt.h +5835 -0
- triton/runtime/tcc/include/winapi/winreg.h +272 -0
- triton/runtime/tcc/include/winapi/winuser.h +5651 -0
- triton/runtime/tcc/include/winapi/winver.h +160 -0
- triton/runtime/tcc/lib/cuda.def +697 -0
- triton/runtime/tcc/lib/gdi32.def +337 -0
- triton/runtime/tcc/lib/kernel32.def +770 -0
- triton/runtime/tcc/lib/libtcc1-64.a +0 -0
- triton/runtime/tcc/lib/msvcrt.def +1399 -0
- triton/runtime/tcc/lib/python3.def +810 -0
- triton/runtime/tcc/lib/user32.def +658 -0
- triton/runtime/tcc/libtcc.dll +0 -0
- triton/runtime/tcc/tcc.exe +0 -0
- {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/METADATA +1 -1
- {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/RECORD +99 -9
- {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/WHEEL +0 -0
- {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
+
* This file is part of the w64 mingw-runtime package.
|
|
4
|
+
* No warranty is given; refer to the file DISCLAIMER within this package.
|
|
5
|
+
*/
|
|
6
|
+
#include <_mingw.h>
|
|
7
|
+
|
|
8
|
+
#ifndef _INC_LIMITS
|
|
9
|
+
#define _INC_LIMITS
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* File system limits
|
|
13
|
+
*
|
|
14
|
+
* TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
|
|
15
|
+
* same as FILENAME_MAX and FOPEN_MAX from stdio.h?
|
|
16
|
+
* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
|
|
17
|
+
* required for the NUL. TODO: Test?
|
|
18
|
+
*/
|
|
19
|
+
#define PATH_MAX (259)
|
|
20
|
+
|
|
21
|
+
#define CHAR_BIT 8
|
|
22
|
+
#define SCHAR_MIN (-128)
|
|
23
|
+
#define SCHAR_MAX 127
|
|
24
|
+
#define UCHAR_MAX 0xff
|
|
25
|
+
|
|
26
|
+
#define CHAR_MIN SCHAR_MIN
|
|
27
|
+
#define CHAR_MAX SCHAR_MAX
|
|
28
|
+
|
|
29
|
+
#define MB_LEN_MAX 5
|
|
30
|
+
#define SHRT_MIN (-32768)
|
|
31
|
+
#define SHRT_MAX 32767
|
|
32
|
+
#define USHRT_MAX 0xffff
|
|
33
|
+
#define INT_MIN (-2147483647 - 1)
|
|
34
|
+
#define INT_MAX 2147483647
|
|
35
|
+
#define UINT_MAX 0xffffffff
|
|
36
|
+
#define LONG_MIN (-2147483647L - 1)
|
|
37
|
+
#define LONG_MAX 2147483647L
|
|
38
|
+
#define ULONG_MAX 0xffffffffUL
|
|
39
|
+
#define LLONG_MAX 9223372036854775807ll
|
|
40
|
+
#define LLONG_MIN (-9223372036854775807ll - 1)
|
|
41
|
+
#define ULLONG_MAX 0xffffffffffffffffull
|
|
42
|
+
|
|
43
|
+
#if _INTEGRAL_MAX_BITS >= 8
|
|
44
|
+
#define _I8_MIN (-127 - 1)
|
|
45
|
+
#define _I8_MAX 127i8
|
|
46
|
+
#define _UI8_MAX 0xffu
|
|
47
|
+
#endif
|
|
48
|
+
|
|
49
|
+
#if _INTEGRAL_MAX_BITS >= 16
|
|
50
|
+
#define _I16_MIN (-32767 - 1)
|
|
51
|
+
#define _I16_MAX 32767i16
|
|
52
|
+
#define _UI16_MAX 0xffffu
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
#if _INTEGRAL_MAX_BITS >= 32
|
|
56
|
+
#define _I32_MIN (-2147483647 - 1)
|
|
57
|
+
#define _I32_MAX 2147483647
|
|
58
|
+
#define _UI32_MAX 0xffffffffu
|
|
59
|
+
#endif
|
|
60
|
+
|
|
61
|
+
#if defined(__GNUC__)
|
|
62
|
+
#undef LONG_LONG_MAX
|
|
63
|
+
#define LONG_LONG_MAX 9223372036854775807ll
|
|
64
|
+
#undef LONG_LONG_MIN
|
|
65
|
+
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
|
|
66
|
+
#undef ULONG_LONG_MAX
|
|
67
|
+
#define ULONG_LONG_MAX (2ull * LONG_LONG_MAX + 1ull)
|
|
68
|
+
#endif
|
|
69
|
+
|
|
70
|
+
#if _INTEGRAL_MAX_BITS >= 64
|
|
71
|
+
#define _I64_MIN (-9223372036854775807ll - 1)
|
|
72
|
+
#define _I64_MAX 9223372036854775807ll
|
|
73
|
+
#define _UI64_MAX 0xffffffffffffffffull
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
#ifndef SIZE_MAX
|
|
77
|
+
#ifdef _WIN64
|
|
78
|
+
#define SIZE_MAX _UI64_MAX
|
|
79
|
+
#else
|
|
80
|
+
#define SIZE_MAX UINT_MAX
|
|
81
|
+
#endif
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
#ifdef _POSIX_
|
|
85
|
+
#define _POSIX_ARG_MAX 4096
|
|
86
|
+
#define _POSIX_CHILD_MAX 6
|
|
87
|
+
#define _POSIX_LINK_MAX 8
|
|
88
|
+
#define _POSIX_MAX_CANON 255
|
|
89
|
+
#define _POSIX_MAX_INPUT 255
|
|
90
|
+
#define _POSIX_NAME_MAX 14
|
|
91
|
+
#define _POSIX_NGROUPS_MAX 0
|
|
92
|
+
#define _POSIX_OPEN_MAX 16
|
|
93
|
+
#define _POSIX_PATH_MAX 255
|
|
94
|
+
#define _POSIX_PIPE_BUF 512
|
|
95
|
+
#define _POSIX_SSIZE_MAX 32767
|
|
96
|
+
#define _POSIX_STREAM_MAX 8
|
|
97
|
+
#define _POSIX_TZNAME_MAX 3
|
|
98
|
+
#define ARG_MAX 14500
|
|
99
|
+
#define LINK_MAX 1024
|
|
100
|
+
#define MAX_CANON _POSIX_MAX_CANON
|
|
101
|
+
#define MAX_INPUT _POSIX_MAX_INPUT
|
|
102
|
+
#define NAME_MAX 255
|
|
103
|
+
#define NGROUPS_MAX 16
|
|
104
|
+
#define OPEN_MAX 32
|
|
105
|
+
#define PATH_MAX 512
|
|
106
|
+
#define PIPE_BUF _POSIX_PIPE_BUF
|
|
107
|
+
#define SSIZE_MAX _POSIX_SSIZE_MAX
|
|
108
|
+
#define STREAM_MAX 20
|
|
109
|
+
#define TZNAME_MAX 10
|
|
110
|
+
#endif
|
|
111
|
+
#endif
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
+
* This file is part of the w64 mingw-runtime package.
|
|
4
|
+
* No warranty is given; refer to the file DISCLAIMER within this package.
|
|
5
|
+
*/
|
|
6
|
+
#ifndef _INC_LOCALE
|
|
7
|
+
#define _INC_LOCALE
|
|
8
|
+
|
|
9
|
+
#include <_mingw.h>
|
|
10
|
+
|
|
11
|
+
#pragma pack(push,_CRT_PACKING)
|
|
12
|
+
|
|
13
|
+
#ifdef __cplusplus
|
|
14
|
+
extern "C" {
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#ifndef NULL
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
#define NULL 0
|
|
20
|
+
#else
|
|
21
|
+
#define NULL ((void *)0)
|
|
22
|
+
#endif
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
#define LC_ALL 0
|
|
26
|
+
#define LC_COLLATE 1
|
|
27
|
+
#define LC_CTYPE 2
|
|
28
|
+
#define LC_MONETARY 3
|
|
29
|
+
#define LC_NUMERIC 4
|
|
30
|
+
#define LC_TIME 5
|
|
31
|
+
|
|
32
|
+
#define LC_MIN LC_ALL
|
|
33
|
+
#define LC_MAX LC_TIME
|
|
34
|
+
|
|
35
|
+
#ifndef _LCONV_DEFINED
|
|
36
|
+
#define _LCONV_DEFINED
|
|
37
|
+
struct lconv {
|
|
38
|
+
char *decimal_point;
|
|
39
|
+
char *thousands_sep;
|
|
40
|
+
char *grouping;
|
|
41
|
+
char *int_curr_symbol;
|
|
42
|
+
char *currency_symbol;
|
|
43
|
+
char *mon_decimal_point;
|
|
44
|
+
char *mon_thousands_sep;
|
|
45
|
+
char *mon_grouping;
|
|
46
|
+
char *positive_sign;
|
|
47
|
+
char *negative_sign;
|
|
48
|
+
char int_frac_digits;
|
|
49
|
+
char frac_digits;
|
|
50
|
+
char p_cs_precedes;
|
|
51
|
+
char p_sep_by_space;
|
|
52
|
+
char n_cs_precedes;
|
|
53
|
+
char n_sep_by_space;
|
|
54
|
+
char p_sign_posn;
|
|
55
|
+
char n_sign_posn;
|
|
56
|
+
};
|
|
57
|
+
#endif
|
|
58
|
+
|
|
59
|
+
#ifndef _CONFIG_LOCALE_SWT
|
|
60
|
+
#define _CONFIG_LOCALE_SWT
|
|
61
|
+
|
|
62
|
+
#define _ENABLE_PER_THREAD_LOCALE 0x1
|
|
63
|
+
#define _DISABLE_PER_THREAD_LOCALE 0x2
|
|
64
|
+
#define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10
|
|
65
|
+
#define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20
|
|
66
|
+
#define _ENABLE_PER_THREAD_LOCALE_NEW 0x100
|
|
67
|
+
#define _DISABLE_PER_THREAD_LOCALE_NEW 0x200
|
|
68
|
+
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
int __cdecl _configthreadlocale(int _Flag);
|
|
72
|
+
char *__cdecl setlocale(int _Category,const char *_Locale);
|
|
73
|
+
_CRTIMP struct lconv *__cdecl localeconv(void);
|
|
74
|
+
_locale_t __cdecl _get_current_locale(void);
|
|
75
|
+
_locale_t __cdecl _create_locale(int _Category,const char *_Locale);
|
|
76
|
+
void __cdecl _free_locale(_locale_t _Locale);
|
|
77
|
+
_locale_t __cdecl __get_current_locale(void);
|
|
78
|
+
_locale_t __cdecl __create_locale(int _Category,const char *_Locale);
|
|
79
|
+
void __cdecl __free_locale(_locale_t _Locale);
|
|
80
|
+
|
|
81
|
+
#ifndef _WLOCALE_DEFINED
|
|
82
|
+
#define _WLOCALE_DEFINED
|
|
83
|
+
_CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale);
|
|
84
|
+
#endif
|
|
85
|
+
|
|
86
|
+
#ifdef __cplusplus
|
|
87
|
+
}
|
|
88
|
+
#endif
|
|
89
|
+
|
|
90
|
+
#pragma pack(pop)
|
|
91
|
+
#endif
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
+
* This file is part of the w64 mingw-runtime package.
|
|
4
|
+
* No warranty is given; refer to the file DISCLAIMER within this package.
|
|
5
|
+
*/
|
|
6
|
+
#ifndef _MALLOC_H_
|
|
7
|
+
#define _MALLOC_H_
|
|
8
|
+
|
|
9
|
+
#include <_mingw.h>
|
|
10
|
+
|
|
11
|
+
#pragma pack(push,_CRT_PACKING)
|
|
12
|
+
|
|
13
|
+
#ifndef _MM_MALLOC_H_INCLUDED
|
|
14
|
+
#define _MM_MALLOC_H_INCLUDED
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#ifdef __cplusplus
|
|
18
|
+
extern "C" {
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#ifdef _WIN64
|
|
22
|
+
#define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0
|
|
23
|
+
#else
|
|
24
|
+
#define _HEAP_MAXREQ 0xFFFFFFE0
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
#ifndef _STATIC_ASSERT
|
|
28
|
+
#define _STATIC_ASSERT(expr) extern void __static_assert_t(int [(expr)?1:-1])
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
/* Return codes for _heapwalk() */
|
|
32
|
+
#define _HEAPEMPTY (-1)
|
|
33
|
+
#define _HEAPOK (-2)
|
|
34
|
+
#define _HEAPBADBEGIN (-3)
|
|
35
|
+
#define _HEAPBADNODE (-4)
|
|
36
|
+
#define _HEAPEND (-5)
|
|
37
|
+
#define _HEAPBADPTR (-6)
|
|
38
|
+
|
|
39
|
+
/* Values for _heapinfo.useflag */
|
|
40
|
+
#define _FREEENTRY 0
|
|
41
|
+
#define _USEDENTRY 1
|
|
42
|
+
|
|
43
|
+
#ifndef _HEAPINFO_DEFINED
|
|
44
|
+
#define _HEAPINFO_DEFINED
|
|
45
|
+
/* The structure used to walk through the heap with _heapwalk. */
|
|
46
|
+
typedef struct _heapinfo {
|
|
47
|
+
int *_pentry;
|
|
48
|
+
size_t _size;
|
|
49
|
+
int _useflag;
|
|
50
|
+
} _HEAPINFO;
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
extern unsigned int _amblksiz;
|
|
54
|
+
|
|
55
|
+
#define _mm_free(a) _aligned_free(a)
|
|
56
|
+
#define _mm_malloc(a,b) _aligned_malloc(a,b)
|
|
57
|
+
|
|
58
|
+
#ifndef _CRT_ALLOCATION_DEFINED
|
|
59
|
+
#define _CRT_ALLOCATION_DEFINED
|
|
60
|
+
void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements);
|
|
61
|
+
void __cdecl free(void *_Memory);
|
|
62
|
+
void *__cdecl malloc(size_t _Size);
|
|
63
|
+
void *__cdecl realloc(void *_Memory,size_t _NewSize);
|
|
64
|
+
_CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
|
|
65
|
+
/* _CRTIMP void __cdecl _aligned_free(void *_Memory);
|
|
66
|
+
_CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment); */
|
|
67
|
+
_CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset);
|
|
68
|
+
_CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment);
|
|
69
|
+
_CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment);
|
|
70
|
+
_CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset);
|
|
71
|
+
_CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset);
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
#define _MAX_WAIT_MALLOC_CRT 60000
|
|
75
|
+
|
|
76
|
+
_CRTIMP int __cdecl _resetstkoflw (void);
|
|
77
|
+
_CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait(unsigned long _NewValue);
|
|
78
|
+
|
|
79
|
+
_CRTIMP void *__cdecl _expand(void *_Memory,size_t _NewSize);
|
|
80
|
+
_CRTIMP size_t __cdecl _msize(void *_Memory);
|
|
81
|
+
#ifdef __GNUC__
|
|
82
|
+
#undef _alloca
|
|
83
|
+
#define _alloca(x) __builtin_alloca((x))
|
|
84
|
+
#else
|
|
85
|
+
/* tcc implements alloca internally and exposes it (since commit d778bde7).
|
|
86
|
+
/* alloca is declared at include/stddef.h (which is distributed with tcc).
|
|
87
|
+
*/
|
|
88
|
+
#ifdef _alloca
|
|
89
|
+
#undef _alloca
|
|
90
|
+
#endif
|
|
91
|
+
#define _alloca(x) alloca((x))
|
|
92
|
+
#endif
|
|
93
|
+
_CRTIMP size_t __cdecl _get_sbh_threshold(void);
|
|
94
|
+
_CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue);
|
|
95
|
+
_CRTIMP errno_t __cdecl _set_amblksiz(size_t _Value);
|
|
96
|
+
_CRTIMP errno_t __cdecl _get_amblksiz(size_t *_Value);
|
|
97
|
+
_CRTIMP int __cdecl _heapadd(void *_Memory,size_t _Size);
|
|
98
|
+
_CRTIMP int __cdecl _heapchk(void);
|
|
99
|
+
_CRTIMP int __cdecl _heapmin(void);
|
|
100
|
+
_CRTIMP int __cdecl _heapset(unsigned int _Fill);
|
|
101
|
+
_CRTIMP int __cdecl _heapwalk(_HEAPINFO *_EntryInfo);
|
|
102
|
+
_CRTIMP size_t __cdecl _heapused(size_t *_Used,size_t *_Commit);
|
|
103
|
+
_CRTIMP intptr_t __cdecl _get_heap_handle(void);
|
|
104
|
+
|
|
105
|
+
#define _ALLOCA_S_THRESHOLD 1024
|
|
106
|
+
#define _ALLOCA_S_STACK_MARKER 0xCCCC
|
|
107
|
+
#define _ALLOCA_S_HEAP_MARKER 0xDDDD
|
|
108
|
+
|
|
109
|
+
#if(defined(_X86_) && !defined(__x86_64))
|
|
110
|
+
#define _ALLOCA_S_MARKER_SIZE 8
|
|
111
|
+
#elif defined(__ia64__) || defined(__x86_64)
|
|
112
|
+
#define _ALLOCA_S_MARKER_SIZE 16
|
|
113
|
+
#endif
|
|
114
|
+
|
|
115
|
+
#if !defined(RC_INVOKED)
|
|
116
|
+
static __inline void *_MarkAllocaS(void *_Ptr,unsigned int _Marker) {
|
|
117
|
+
if(_Ptr) {
|
|
118
|
+
*((unsigned int*)_Ptr) = _Marker;
|
|
119
|
+
_Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE;
|
|
120
|
+
}
|
|
121
|
+
return _Ptr;
|
|
122
|
+
}
|
|
123
|
+
#endif
|
|
124
|
+
|
|
125
|
+
#undef _malloca
|
|
126
|
+
#define _malloca(size) \
|
|
127
|
+
((((size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) ? \
|
|
128
|
+
_MarkAllocaS(_alloca((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_STACK_MARKER) : \
|
|
129
|
+
_MarkAllocaS(malloc((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_HEAP_MARKER))
|
|
130
|
+
#undef _FREEA_INLINE
|
|
131
|
+
#define _FREEA_INLINE
|
|
132
|
+
|
|
133
|
+
#ifndef RC_INVOKED
|
|
134
|
+
#undef _freea
|
|
135
|
+
static __inline void __cdecl _freea(void *_Memory) {
|
|
136
|
+
unsigned int _Marker;
|
|
137
|
+
if(_Memory) {
|
|
138
|
+
_Memory = (char*)_Memory - _ALLOCA_S_MARKER_SIZE;
|
|
139
|
+
_Marker = *(unsigned int *)_Memory;
|
|
140
|
+
if(_Marker==_ALLOCA_S_HEAP_MARKER) {
|
|
141
|
+
free(_Memory);
|
|
142
|
+
}
|
|
143
|
+
#ifdef _ASSERTE
|
|
144
|
+
else if(_Marker!=_ALLOCA_S_STACK_MARKER) {
|
|
145
|
+
_ASSERTE(("Corrupted pointer passed to _freea",0));
|
|
146
|
+
}
|
|
147
|
+
#endif
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
#endif /* RC_INVOKED */
|
|
151
|
+
|
|
152
|
+
#ifndef NO_OLDNAMES
|
|
153
|
+
#ifdef __GNUC__
|
|
154
|
+
#undef alloca
|
|
155
|
+
#define alloca(x) __builtin_alloca((x))
|
|
156
|
+
#endif
|
|
157
|
+
#endif
|
|
158
|
+
|
|
159
|
+
#ifdef HEAPHOOK
|
|
160
|
+
#ifndef _HEAPHOOK_DEFINED
|
|
161
|
+
#define _HEAPHOOK_DEFINED
|
|
162
|
+
typedef int (__cdecl *_HEAPHOOK)(int,size_t,void *,void **);
|
|
163
|
+
#endif
|
|
164
|
+
|
|
165
|
+
_CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK _NewHook);
|
|
166
|
+
|
|
167
|
+
#define _HEAP_MALLOC 1
|
|
168
|
+
#define _HEAP_CALLOC 2
|
|
169
|
+
#define _HEAP_FREE 3
|
|
170
|
+
#define _HEAP_REALLOC 4
|
|
171
|
+
#define _HEAP_MSIZE 5
|
|
172
|
+
#define _HEAP_EXPAND 6
|
|
173
|
+
#endif
|
|
174
|
+
|
|
175
|
+
#ifdef __cplusplus
|
|
176
|
+
}
|
|
177
|
+
#endif
|
|
178
|
+
|
|
179
|
+
#pragma pack(pop)
|
|
180
|
+
|
|
181
|
+
#endif /* _MALLOC_H_ */
|