Commit Graph

34 Commits

Author SHA1 Message Date
Jost Berthold
fb2aac53ba Update Pack.c code for ghc-8.6, version bump 2018-08-20 21:10:55 +10:00
Jost Berthold
d3f2767356 Finalise release which works with GHC-8.2 and base-4.10
* bump base dependency
* add new header files to cabal file
* bump version, update "tested-with", update stack resolver

+ fix a format string warning in Pack.c
2018-01-19 20:14:31 +11:00
Jost Berthold
1d95b387aa assimilate HEAP_ALLOCED source for GHC >= 801 2018-01-18 22:41:35 +11:00
Jost Berthold
18f9928093 several updates to Pack.c, to support ghc-8.0 and onwards 2017-01-09 14:46:38 +11:00
Jost Berthold
2cbe45cb27 IND_PERM removal, sync.ed with GHC head 2016-02-21 13:45:04 +11:00
Jost Berthold
f51cf8b784 follow renaming of StgArrWords to StgArrBytes 2015-12-01 19:46:27 +11:00
Jost Berthold
7f8cc06ac8 fix debug version of Pack.c 2015-12-01 01:46:21 +11:00
Jost Berthold
4e9549fad6 support base 4.8.0 (TypeRep changed) 2015-06-22 23:19:14 +10:00
Jost Berthold
679a35a5dc adopt using Rts flag from RTS code (irrelevant here) 2014-09-11 11:28:03 +02:00
Jost Berthold
464cb03fa2 Block/retry if a blackhole is met during packing
If packing hits a blackhole, the packing thread should block
and retry, to get consistent behaviour at the Haskell level.
To enable this from Haskell, the core routine now checks and
evaluates the blackhole before retrying (i.e. blocks on the
known-to-be-blackholed data).

As the blackhole is not necessarily (and most likely not) the
graphroot, the C code writes its address into the buffer at
position 0. This is OK since packing fails anyway, so the buffer
won't hold any useful data.
2014-09-06 20:34:17 +02:00
Jost Berthold
d6d6b18a99 split into several modules, use hsc2hs for error codes 2014-08-28 14:23:04 +02:00
Jost Berthold
cdc1f6f41a added tryPackToMemory version for in-RTS 2014-08-22 17:42:44 +02:00
Jost Berthold
c5ac891520 fixing small problems that showed in the RTS 2014-08-22 16:57:30 +02:00
Jost Berthold
1a3dedf440 Enable sharing Pack.c between RTS and library
Using a PP flag LIBRARY_CODE, the code of Pack.c is split up into
parts necessary for the library and parts required for the RTS
(negation of LIBRARY_CODE); the rest is shared code.
2014-08-22 15:54:44 +02:00
Jost Berthold
f4b6a968b8 make all internal functions static, rename
This prepares for fitting the revised Pack.c of packman into the
parallel GHC runtime system. The module should not export any
functions without need, and prefix all exported ones with "pm".

Exported:

int pmtryPackToBuffer(StgClosure* closure, StgArrWords* mutArr);
StgClosure* pmUnpackGraphWrapper(StgArrWords* packBufferArray, Capability* cap);
2014-08-22 10:57:59 +02:00
Jost Berthold
82078f8eba Accidental conflict in cbits/Pack.c (reformatting/amend) 2014-08-19 11:24:09 +02:00
Jost Berthold
c0437f4c6c new PAP packing code
Old code was wasting a lot of space by packing tags for stack values
to indicate their pointer-hood. Instead, the new version packs the
original bitmap and uses it for unpacking.
The bitmap is actually present at the receiver side, but as part of
the function info table - the function arrives later so it cannot be
used from there.

There is code for the large bitmap case, but it is not activated yet.
2014-08-19 11:23:00 +02:00
Jost Berthold
446bf6286e new PAP packing code
Old code was wasting a lot of space by packing tags for stack values
to indicate their pointer-hood. Instead, the new version packs the
original bitmap and uses it for unpacking.
The bitmap is actually present at the receiver side, but as part of
the function info table - the function arrives later so it cannot be
used from there.

There is code for the large bitmap case, but it is not activated yet.
2014-08-19 11:10:27 +02:00
Jost Berthold
e03c67de2d Rewritten Pack.c, eliminating all global variables
Pack.c should now be thread-safe for unpacking and packing,
as its functions pass around an explicitly allocated state.
changes should eventually go back into the RTS code (but we
need to see the performance first).

The PAP case has not been rewritten yet, it should be revised
to pack the bitmap instead of tagging the packed stack elements.
2014-08-15 15:58:16 +02:00
Jost Berthold
c1be91ca68 whitespace cleanup in Pack.c 2014-08-14 13:39:53 +02:00
Jost Berthold
714ab55854 Some adjustments, towards more robust version
- lock (haskell level)
- cabal file and C code with debug support
- test suite (one program for now)
2014-07-24 20:35:52 +02:00
Jost Berthold
4404821e46 renamed some functions to avoid name clashes with Par.RTS 2014-07-23 22:47:39 +02:00
Michael Budde
2236bf1136 Init pack buffer at startup
The GCC `constructor` attribute is used ensure that the function will be
called when the library is loaded at startup.
2014-05-22 19:43:28 +02:00
Michael Budde
b4b3e1195a Style 2014-05-22 19:28:10 +02:00
Michael Budde
7055c64137 Use IF_DEBUG instead of IF_PAR_DEBUG 2014-05-22 18:10:50 +02:00
Michael Budde
734b7be134 Use internal functions in GHC instead of copying the source 2014-05-22 18:10:08 +02:00
Jost Berthold
5c38d6317b Use private functions from GHC runtime 2014-05-22 18:08:42 +02:00
Jost Berthold
2d990576ef Rename functions to prevent collision with Eden implementations 2014-05-22 18:07:42 +02:00
Jost Berthold
eaaab29474 Remove unnecessary stuff from packing buffer structure 2014-05-22 18:03:53 +02:00
Michael Budde
ae51b45995 Add deserialize and convert to a library 2014-05-20 13:16:49 +02:00
Michael Budde
b2d370023f Reform pack file 2014-05-19 21:46:38 +02:00
Michael Budde
efe634ded1 Import Pack.c from Eden RTS 2014-05-19 13:53:09 +02:00
Michael Budde
bb5ebede50 Import Pack.c from Eden 2014-05-19 10:49:06 +02:00
Michael Budde
9f5a8a83ad Initial commit 2014-05-14 23:00:13 +02:00