summaryrefslogtreecommitdiff
path: root/rts/posix/OSMem.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Check for integer overflow in osGetMBlocks"Austin Seipp2013-08-291-12/+1
| | | | | | This reverts commit 48865521de6638240819b3979edbb3d33401dc8e. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Revert "Paranoid integer overflow check in my_mmap"Austin Seipp2013-08-291-3/+0
| | | | | | This reverts commit 1ce65edbff90fc8103062a1f94258ecc0c682309. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Revert "Paranoid integer overflow check in osGetMBlocks"Austin Seipp2013-08-291-2/+1
| | | | | | This reverts commit 1247dff7b852d45dc5006ae8be33ac991cc76c74. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Paranoid integer overflow check in osGetMBlocksReid Barton2013-08-291-1/+2
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Paranoid integer overflow check in my_mmapReid Barton2013-08-291-0/+3
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Check for integer overflow in osGetMBlocksReid Barton2013-08-291-1/+12
| | | | | | Fixes Trac #5188. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* some more typosGabor Greif2013-02-021-1/+1
|
* More OS X build fixesIan Lynagh2012-09-141-2/+2
|
* Deprecate lnat, and use StgWord insteadSimon Marlow2012-09-071-6/+6
| | | | | | | | | | | | lnat was originally "long unsigned int" but we were using it when we wanted a 64-bit type on a 64-bit machine. This broke on Windows x64, where long == int == 32 bits. Using types of unspecified size is bad, but what we really wanted was a type with N bits on an N-bit machine. StgWord is exactly that. lnat was mentioned in some APIs that clients might be using (e.g. StackOverflowHook()), so we leave it defined but with a comment to say that it's deprecated.
* Fixes for x86/LinuxIan Lynagh2012-04-301-1/+1
|
* On Windows, when returning memory to the OS, we try to release itIan Lynagh2010-11-011-0/+4
| | | | as well as decommiting it.
* Return memory to the OS; trac #698Ian Lynagh2010-08-131-24/+10
|
* undo debugging codeSimon Marlow2010-04-061-3/+2
|
* New implementation of BLACKHOLEsSimon Marlow2010-03-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the global blackhole_queue with a clever scheme that enables us to queue up blocked threads on the closure that they are blocked on, while still avoiding atomic instructions in the common case. Advantages: - gets rid of a locked global data structure and some tricky GC code (replacing it with some per-thread data structures and different tricky GC code :) - wakeups are more prompt: parallel/concurrent performance should benefit. I haven't seen anything dramatic in the parallel benchmarks so far, but a couple of threading benchmarks do improve a bit. - waking up a thread blocked on a blackhole is now O(1) (e.g. if it is the target of throwTo). - less sharing and better separation of Capabilities: communication is done with messages, the data structures are strictly owned by a Capability and cannot be modified except by sending messages. - this change will utlimately enable us to do more intelligent scheduling when threads block on each other. This is what started off the whole thing, but it isn't done yet (#3838). I'll be documenting all this on the wiki in due course.
* Cast to (void*) to stifle warning about signednessbenl@cse.unsw.edu.au2010-02-031-2/+2
|
* FIX #711 implement osFreeAllMBlocks for unixAustin Seipp2009-09-101-3/+28
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* wibble in setExecutableAustin Seipp2009-03-201-1/+1
|
* Remover PROT_EXEC flag from mmap()Simon Marlow2008-09-301-2/+2
| | | | Needed for #738 fix
* FIX #2332: avoid overflow on 64-bit machines in the memory allocatorSimon Marlow2008-07-291-1/+1
|
* FIX BUILD (Solaris): include fcntl.h for file operationsRoman Leshchinskiy2008-01-151-0/+3
|
* Fix warning in OSMem for darwinManuel M T Chakravarty2007-10-301-1/+1
|
* Refactoring: extract platform-specific code from sm/MBlock.cSimon Marlow2007-10-171-1/+196
| | | | Also common-up some duplicate bits in the platform-specific code
* avoid platform dependencies: my_uintptr_t ==> StgWordSimon Marlow2007-09-171-13/+5
|
* replace stgMallocBytesRWX() with our own allocatorSimon Marlow2006-05-301-0/+52
See bug #738 Allocating executable memory is getting more difficult these days. In particular, the default SELinux policy on Fedora Core 5 disallows making the heap (i.e. malloc()'d memory) executable, although it does apparently allow mmap()'ing anonymous executable memory by default. Previously, stgMallocBytesRWX() used malloc() underneath, and then tried to make the page holding the memory executable. This was rather hacky and fails with Fedora Core 5. This patch adds a mini-allocator for executable memory, based on the block allocator. We grab page-sized blocks and make them executable, then allocate small objects from the page. There's a simple free function, that will free whole pages back to the system when they are empty.