1. 22 Nov, 2002 2 commits
  2. 07 Nov, 2002 1 commit
  3. 05 Nov, 2002 3 commits
  4. 27 Oct, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-10-27 21:46:27 by wolfgang] · 80498a8a
      wolfgang authored
      For Mac OS X, use the underlying Mach Microkernel calls instead of mmap.
      Darwin's mmap doesn't honor the passed-in address without MAP_FIXED,
      and MAP_FIXED replaces all existing mappings, so it can't be used.
      80498a8a
  5. 25 Oct, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-10-25 12:56:34 by simonmar] · 24889e6a
      simonmar authored
      We shouldn't be using MAP_FIXED on solaris (fixes last night's crash).
      
      Unfortunately on Solaris the heuristics don't work too well.  Solaris
      seems to ignore the addr argument to mmap when MAP_FIXED is not
      specified, and starts handing out memory from the top of the address
      space.  So we allocate 2M each time and munmap() ends to leave an
      aligned 1M chunk.  This will eventually leave the address space
      completely full of 1M holes.  I don't have a good solution to this at
      the moment.
      
      MERGE TO STABLE
      24889e6a
  6. 23 Oct, 2002 1 commit
  7. 21 Oct, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-10-21 12:42:31 by simonmar] · 5cc57129
      simonmar authored
      Turn an instance of 0xfff00000 into ~MBLOCK_MASK in the Win32 code.
      5cc57129
    • simonmar's avatar
      [project @ 2002-10-21 11:38:53 by simonmar] · 2be44cb2
      simonmar authored
      Bite the bullet and generalise the central memory allocation scheme.
      Previously we tried to allocate memory starting from a fixed address,
      which was set for each architecture (0x5000000 was a common one), and
      to decide whether a particular address was in the heap or not we would
      do a simple comparison against this address.
      
      This doesn't work too well, because:
      
       - if we dynamically-load some objects above the boundary, the
         heap-allocated test becomes invalid
      
       - on windows we have less control, and the heap might be
         split into multiple sections
      
       - it turns out that on some Linux kernels we don't get memory where
         we asked for it.  This might be a bug in those kernels, but it
         exposes the fragility of our allocation scheme.
      
      The solution is to bite the bullet and maintain a table mapping
      addresses to a value indicating whether that address is in the heap or
      not.  Since we normally allocate heap in chunks of 1Mb, the table is
      quite small: 4k on a 32-bit machine, using one byte for each 1Mb
      block.  Testing an address for heap residency now involves a memory
      access, but the table is normally cache-resident.  I didn't manage to
      measure any slowdown after making the change.
      
      On a 64-bit machine, we'll need to use a 2-level table; I haven't
      implemented that yet.
      
      Now we can generalise the procedure used to grab memory from the OS.
      In the general case, we allocate one megablock more than we need to,
      and trim off the slop around the allocation to leave an aligned chunk.
      The next time around, however, we try to allocate memory right after
      the last chunk allocated, on the grounds that it is aligned and
      probably free: if this doesn't work, we have to back off to the
      general mechanism (it seems to work most of the time).
      
      This cleans up the Windows story too: is_heap_alloced() has gone, and
      we should be able to handle more than 256M of memory (or whatever the
      arbitrary limit was before).
      
      MERGE TO STABLE (after lots of testing)
      2be44cb2
  8. 17 Jul, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-07-17 09:21:48 by simonmar] · 7457757f
      simonmar authored
      Remove most #includes of system headers from Stg.h, and instead
      #include any required headers directly in each RTS source file.
      
      The idea is to (a) reduce namespace pollution from system headers that
      we don't need, (c) be clearer about dependencies on system things in
      the RTS, and (c) improve via-C compilation times (maybe).
      
      In practice though, HsBase.h #includes everything anyway, so the
      difference from the point of view of .hc source is minimal.  However,
      this makes it easier to move to zero-includes if we wanted to (see
      discussion on the FFI list; I'm still not sure that's possible but
      at least this is a step in the right direction).
      7457757f
  9. 12 Apr, 2002 1 commit
  10. 26 Mar, 2002 1 commit
  11. 08 Jan, 2002 1 commit
    • sof's avatar
      [project @ 2002-01-08 16:38:27 by sof] · dd7f7b3d
      sof authored
      Make better use of the -M<size> setting under Win32. Use it to guide
      the amount of VM to reserve -- the default is (still) 256M, but the
      user will now have a way of overriding this setting.
      dd7f7b3d
  12. 10 Dec, 2001 1 commit
  13. 26 Oct, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-10-26 11:49:19 by sewardj] · 80ca788a
      sewardj authored
      merge from stable, rev 1.23.4.1:
      
        Win32 only: implement sane failure semantics + message when out of
        memory, rather than continuing and allowing the rest of the system
        to seg out.  Also, increase the 128M limit to 256M.
      
        This allegedly fixes the Antony Courtney Win32 segfault.
      80ca788a
  14. 14 Aug, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-08-14 13:40:07 by sewardj] · bc5c8021
      sewardj authored
      Change the story about POSIX headers in C compilation.
      
      Until now, all C code in the RTS and library cbits has by default been
      compiled with settings for POSIXness enabled, that is:
         #define _POSIX_SOURCE   1
         #define _POSIX_C_SOURCE 199309L
         #define _ISOC9X_SOURCE
      If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
      before including headers.
      
      This scheme has some bad effects:
      
      * It means that ccall-unfoldings exported via interfaces from a
        module compiled with -DNON_POSIX_SOURCE may not compile when
        imported into a module which does not -DNON_POSIX_SOURCE.
      
      * It overlaps with the feature tests we do with autoconf.
      
      * It seems to have caused borkage in the Solaris builds for some
        considerable period of time.
      
      The New Way is:
      
      * The default changes to not-being-in-Posix mode.
      
      * If you want to force a C file into Posix mode, #include as
        the **first** include the new file ghc/includes/PosixSource.h.
        Most of the RTS C sources have this include now.
      
      * NON_POSIX_SOURCE is almost totally expunged.  Unfortunately
        we have to retain some vestiges of it in ghc/compiler so that
        modules compiled via C on Solaris using older compilers don't
        break.
      bc5c8021
  15. 24 Jul, 2001 1 commit
  16. 16 Jan, 2001 1 commit
  17. 16 Dec, 2000 1 commit
  18. 04 Dec, 2000 1 commit
  19. 06 Sep, 2000 1 commit
    • rrt's avatar
      [project @ 2000-09-06 11:12:07 by rrt] · e349469c
      rrt authored
      Made message for exceeding 128Mb of heap on Windows more helpful, and
      only abort when this limit is exceeded, not on first memory allocation!
      e349469c
  20. 17 Aug, 2000 1 commit
    • rrt's avatar
      [project @ 2000-08-17 15:21:55 by rrt] · 39cbf830
      rrt authored
      barf when a DLLized RTS tries to allocate a 2nd Windows monster block;
      is_heap_alloced stops working at this point. No problem for the static
      build.
      39cbf830
  21. 04 Aug, 2000 1 commit
    • lewie's avatar
      [project @ 2000-08-04 23:31:43 by lewie] · 39318542
      lewie authored
      Port to OpenBSD from Thomas Nordin.  Please merge with 4.08 (you'll also
      need the new config.guess and config.sub from the previous commit).
      39318542
  22. 03 Apr, 2000 1 commit
    • rrt's avatar
      [project @ 2000-04-03 15:24:21 by rrt] · a0b380bb
      rrt authored
      Stopped getourtimeofday() being called under mingwin.
      MBlock.c: changed one instance of 128 * 1024 * 1024 into SIZE_RESERVED_POOL
      and added a TODO comment (bug in is_heap_alloced(), which won't work if
      more than one megablock is ever allocated).
      a0b380bb
  23. 22 Jan, 2000 1 commit
  24. 15 Dec, 1999 1 commit
  25. 16 Sep, 1999 1 commit
  26. 11 Mar, 1999 1 commit
  27. 03 Mar, 1999 1 commit
    • sof's avatar
      [project @ 1999-03-03 19:04:56 by sof] · 9bebeb69
      sof authored
      Added is_heap_alloced() to the API - returns true if an address is
      within the range of addresses that we've been given back from the
      OS.
      
      Only needed for Win32 DLLs, so it's only defined when compiling up
      a Win32 RTS DLL.
      9bebeb69
  28. 05 Feb, 1999 1 commit
  29. 26 Jan, 1999 1 commit
  30. 25 Jan, 1999 1 commit
  31. 18 Jan, 1999 2 commits
  32. 14 Jan, 1999 1 commit
    • sof's avatar
      [project @ 1999-01-14 18:31:17 by sof] · 8b7dc908
      sof authored
      Forgot to commit this before Christmas...on Win32 platforms use
      VirtualAlloc() instead CreateFileMapping()&friends to ask for
      mega-blocks from the OS. Windows 95-friendlier.
      8b7dc908
  33. 13 Jan, 1999 1 commit
    • simonm's avatar
      [project @ 1999-01-13 17:25:37 by simonm] · 4391e44f
      simonm authored
      Added a generational garbage collector.
      
      The collector is reliable but fairly untuned as yet.  It works with an
      arbitrary number of generations: use +RTS -G<gens> to change the
      number of generations used (default 2).
      
      Stats: +RTS -Sstderr is quite useful, but to really see what's going
      on compile the RTS with -DDEBUG and use +RTS -D32.
      
      ARR_PTRS removed - it wasn't used anywhere.
      
      Sanity checking improved:
      	- free blocks are now spammed when sanity checking is turned on
      	- a check for leaking blocks is performed after each GC.
      4391e44f
  34. 02 Dec, 1998 1 commit