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
Environments
Terraform modules
Monitor
Incidents
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
Alexander Kaznacheev
GHC
Commits
c2ef200e
Commit
c2ef200e
authored
11 years ago
by
Simon Marlow
Committed by
Austin Seipp
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix comment on allocate() (#8254)
(cherry picked from commit
68c0d868
)
parent
c0da98f8
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rts/sm/Storage.c
+14
-12
14 additions, 12 deletions
rts/sm/Storage.c
with
14 additions
and
12 deletions
rts/sm/Storage.c
+
14
−
12
View file @
c2ef200e
...
@@ -662,20 +662,22 @@ move_STACK (StgStack *src, StgStack *dest)
...
@@ -662,20 +662,22 @@ move_STACK (StgStack *src, StgStack *dest)
}
}
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
allocate()
StgPtr allocate (Capability *cap, W_ n)
This allocates memory in the current thread - it is intended for
Allocates an area of memory n *words* large, from the nursery of
use primarily from STG-land where we have a Capability. It is
the supplied Capability, or from the global block pool if the area
better than allocate() because it doesn't require taking the
requested is larger than LARGE_OBJECT_THRESHOLD. Memory is not
sm_mutex lock in the common case.
allocated from the current nursery block, so as not to interfere
with Hp/HpLim.
Memory is allocated directly from the nursery if possible (but not
from the current nursery block, so as not to interfere with
The address of the allocated memory is returned. allocate() never
Hp/HpLim).
fails; if it returns, the returned value is a valid address. If
the nursery is already full, then another block is allocated from
the global block pool. If we need to get memory from the OS and
that operation fails, then the whole process will be killed.
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
StgPtr
StgPtr
allocate
(
Capability
*
cap
,
W_
n
)
allocate
(
Capability
*
cap
,
W_
n
)
{
{
bdescr
*
bd
;
bdescr
*
bd
;
StgPtr
p
;
StgPtr
p
;
...
...
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