summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/Memory.inc
Commit message (Collapse)AuthorAgeFilesLines
* llvm-ar: Fix MinGW compilationHans Wennborg2020-02-281-1/+1
| | | | | | | | | | | | | | | | llvm-ar is using CompareStringOrdinal which is available only starting with Windows Vista (WINVER 0x600). Fix this by hoising WindowsSupport.h, which sets _WIN32_WINNT to 0x0601, up to llvm/include/llvm/Support and use it in llvm-ar. Patch by Cristian Adam! Differential revision: https://reviews.llvm.org/D74599 (cherry picked from commit 01f9abbb50b11dd26b9ccb7cb565cc955d2b9c74) This is for https://bugs.llvm.org/show_bug.cgi?id=44907
* [Support][NFC] Make some helper functions "static" in Memory.incBruno Ricci2020-01-091-6/+2
|
* [Support] Renamed member 'Size' to 'AllocatedSize' in MemoryBlock and ↵Lang Hames2019-05-201-7/+7
| | | | | | | | | | | | | | | OwningMemoryBlock. Rename member 'Size' to 'AllocatedSize' in order to provide a hint that the allocated size may be different than the requested size. Comments are added to clarify this point. Updated the InMemoryBuffer in FileOutputBuffer.cpp to track the requested buffer size. Patch by Machiel van Hooren. Thanks Machiel! https://reviews.llvm.org/D61599 llvm-svn: 361195
* [Support] MemoryBlock size should reflect the requested sizeAndrew Ng2019-03-271-3/+4
| | | | | | | | | | This patch mirrors the change made to the Unix equivalent in r351916. This in turn fixes bugs related to the use of FileOutputBuffer to output to "-", i.e. stdout, on Windows. Differential Revision: https://reviews.llvm.org/D59663 llvm-svn: 357058
* Fix SupportTests.exe/AllocationTests/MappedMemoryTest.AllocAndReleaseHuge ↵Alexandre Ganea2019-02-281-3/+3
| | | | | | when the machine doesn't have large pages enabled. llvm-svn: 355067
* [Memory] Add basic support for large/huge memory pagesAlexandre Ganea2019-02-281-18/+54
| | | | | | | | | | | | | | | | | This patch introduces Memory::MF_HUGE_HINT which indicates that allocateMappedMemory() shall return a pointer to a large memory page. However the flag is a hint because we're not guaranteed in any way that we will get back a large memory page. There are several restrictions: - Large/huge memory pages aren't enabled by default on modern OSes (Windows 10 and Linux at least), and should be manually enabled/reserved. - Once enabled, it should be kept in mind that large pages are physical only, they can't be swapped. - Memory fragmentation can affect the availability of large pages, especially after running the OS for a long time and/or running along many other applications. Memory::allocateMappedMemory() will fallback to 4KB pages if it can't allocate 2MB large pages (if Memory::MF_HUGE_HINT is provided) Currently, Memory::MF_HUGE_HINT only works on Windows. The hint will be ignored on Linux, 4KB pages will always be returned. Differential Revision: https://reviews.llvm.org/D58718 llvm-svn: 355065
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Support] Support NetBSD PaX MPROTECT in sys::Memory.Lang Hames2017-11-161-80/+0
| | | | | | | | | Removes AllocateRWX, setWritable and setExecutable from sys::Memory and standardizes on allocateMappedMemory / protectMappedMemory. The allocateMappedMemory method is updated to request full permissions for memory blocks so that they can be marked executable later. llvm-svn: 318464
* Add Windows error code and tidy formatting for system errors.Paul Robinson2015-11-231-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D14892 llvm-svn: 253888
* [Support] Fix a race initializing a static local in MSVCReid Kleckner2015-06-111-1/+9
| | | | | | | | | static local initialization isn't thread safe with MSVC and a race was reported in PR23817. We can't use std::atomic because it's not trivially constructible, so instead do some lame volatile global integer manipulation. llvm-svn: 239566
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-131-13/+12
| | | | llvm-svn: 210871
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Used mapWindowsError. I missed these in the initial transition.Rafael Espindola2014-06-121-3/+4
| | | | llvm-svn: 210729
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-7/+7
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209952
* Rename Windows.h to WindowsSupport.h to avoid ambiguityReid Kleckner2014-02-121-1/+1
| | | | llvm-svn: 201258
* Fix a conversion warning in the mingw32 buildAlp Toker2013-10-181-2/+2
| | | | | | | | | | | gcc diagnoses this: warning: converting to non-pointer type 'unsigned int' from NULL Also remove an empty statement. No change in functionality. llvm-svn: 192955
* Add a comment about the requirement that the Windows.h header be last.Chandler Carruth2012-12-041-0/+2
| | | | | | | This comment has the dual effect of blocking reorderings with the sort_include script. llvm-svn: 169221
* Revert the header sort on this file.Michael J. Spencer2012-12-031-1/+1
| | | | | | | | "Windows.h" includes <Windows.h> which defines a bunch of stuff it shouldn't (even with all the restriction macros). We have no control over this file, so make it's scope as small as possible. llvm-svn: 169165
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* This patch adds memory support functions which will later be used to ↵Andrew Kaylor2012-09-191-26/+139
| | | | | | implement section-specific protection handling in MCJIT. llvm-svn: 164249
* Windows/Memory.inc: Support the ability to allocate memory "near" another ↵NAKAMURA Takumi2011-10-151-2/+7
| | | | | | | | block of memory on Win32. It has fixed FIXME. Thanks to Aaron Ballman! llvm-svn: 142039
* Support/Windows: Add support modifying memory permissions on Windows. Patch ↵Michael J. Spencer2011-10-131-3/+45
| | | | | | by Aaron Ballman! llvm-svn: 141910
* Merge System into Support.Michael J. Spencer2010-11-291-0/+73
llvm-svn: 120298
OpenPOWER on IntegriCloud