Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve default allocator wording #649

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4889,11 +4889,9 @@ can supply their own allocator class.
}
----

When an allocator returns a [code]#nullptr#, the runtime cannot allocate data on
the host.
Note that in this case the runtime will raise an error if it requires host
memory but it is not available (e.g when moving data across <<backend>>
contexts).
Note that if the runtime requires host memory (e.g., when moving data across
<<backend>> contexts), but the allocator fails to allocate the memory, then the
runtime will raise an error.

In some cases, the implementation may retain a copy of the allocator object even
after the buffer is destroyed.
Expand All @@ -4918,8 +4916,6 @@ STL-based libraries (e.g, Intel's TBB provides an allocator).
==== Default allocators

A default allocator is always defined by the implementation.
For allocations greater than size zero, when successful it is guaranteed to
return non-[code]#nullptr# and new memory positions every call.
The default allocator for const buffers will remove the const-ness of the type
(therefore, the default allocator for a buffer of type [code]#const int# will be
an [code]#Allocator<int>)#.
Expand Down