Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
9065404a
Commit
9065404a
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-09-29 15:50:13 by sof]
merged from HEAD
parent
f589a1b3
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc/lib/misc/CString.lhs
+7
-10
7 additions, 10 deletions
ghc/lib/misc/CString.lhs
ghc/lib/misc/cbits/socketOpt.c
+2
-1
2 additions, 1 deletion
ghc/lib/misc/cbits/socketOpt.c
with
9 additions
and
11 deletions
ghc/lib/misc/CString.lhs
+
7
−
10
View file @
9065404a
...
...
@@ -54,10 +54,7 @@ module CString
import PrelPack
import GlaExts
import Addr
import PrelIOBase ( IO(..), IOResult(..))
import PrelArr ( StateAndMutableByteArray#(..),
StateAndByteArray#(..)
)
import PrelIOBase ( IO(..) )
\end{code}
...
...
@@ -164,21 +161,21 @@ out the bounds - use with care.
allocChars :: Int -> IO (MutableByteArray RealWorld Int)
allocChars (I# size#) = IO $ \ s# ->
case newCharArray# size# s# of
StateAndMutableByteArray
# s2# barr# ->
IOok
s2# (MutableByteArray (I# 1#, I# size#) barr#)
(
# s2#
,
barr#
#)
->
(#
s2#
,
(MutableByteArray (I# 1#, I# size#) barr#)
#)
allocWords :: Int -> IO (MutableByteArray RealWorld Int)
allocWords (I# size#) = IO $ \ s# ->
case newIntArray# size# s# of
StateAndMutableByteArray
# s2# barr# ->
IOok
s2# (MutableByteArray (I# 1#, I# size#) barr#)
(
# s2#
,
barr#
#)
->
(#
s2#
,
(MutableByteArray (I# 1#, I# size#) barr#)
#)
-- Freeze these index-free mutable arrays
freeze :: MutableByteArray RealWorld Int -> IO (ByteArray Int)
freeze (MutableByteArray ixs arr#) = IO $ \ s# ->
case unsafeFreezeByteArray# arr# s# of
StateAndByteArray
# s2# frozen# ->
IOok
s2# (ByteArray ixs frozen#)
(
# s2#
,
frozen#
#)
->
(#
s2#
,
(ByteArray ixs frozen#)
#)
-- Copy a null-terminated string from outside the heap to
-- Haskellized nonsense inside the heap
...
...
This diff is collapsed.
Click to expand it.
ghc/lib/misc/cbits/socketOpt.c
+
2
−
1
View file @
9065404a
...
...
@@ -8,8 +8,9 @@
#endif
#define NON_POSIX_SOURCE
#include
"
rtsdef
s.h"
#include
"
Rt
s.h"
#include
"ghcSockets.h"
#include
"stgio.h"
StgInt
getSocketOption__
(
fd
,
opt
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment