View source code
							
							
						
								Display the source code in std/experimental/allocator/building_blocks/region.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Struct std.experimental.allocator.building_blocks.region.SharedBorrowedRegion
A SharedBorrowedRegion allocates directly from a user-provided block of memory.
						
				struct SharedBorrowedRegion(uint minAlign = platformAlignment, Flag!("growDownwards") growDownwards = No
				Unlike a SharedRegion, a SharedBorrowedRegion does not own the memory it
allocates from and will not deallocate that memory upon destruction. Instead,
it is the user's responsibility to ensure that the memory is properly disposed
of.
In all other respects, a SharedBorrowedRegion behaves exactly like a SharedRegion.
Constructors
| Name | Description | 
|---|---|
| this(store) | Constructs a region backed by a user-provided store. | 
Methods
| Name | Description | 
|---|---|
| alignedAllocate(n, a) | Allocates nbytes of memory aligned at alignmenta. | 
| allocate(n) | Allocates nbytes of memory. The allocation is served by atomically incrementing
    a pointer which keeps track of the current used space. | 
| deallocate(b) | Deallocates b. This works only ifbwas obtained as the last call
    toallocate; otherwise (i.e. another allocation has occurred since) it
    does nothing. | 
| deallocateAll() | Deallocates all memory allocated by this region, which can be subsequently reused for new allocations. | 
| empty() | Returns Ternaryif no memory has been allocated in this region,Ternaryotherwise. (Never returnsTernary.) | 
| goodAllocSize(n) | Rounds the given size to a multiple of the alignment | 
| owns(b) | Queries whether bhas been allocated with this region. | 
Aliases
| Name | Description | 
|---|---|
| alignment | Alignment offered. | 
Authors
License
					Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.