Skip to content

Commit

Permalink
Merge pull request #593 from gmlueck/gmlueck/free-null
Browse files Browse the repository at this point in the history
Clarify that "sycl::free(nullptr)" does nothing
  • Loading branch information
tomdeakin authored Jul 25, 2024
2 parents 0bba4db + c7886db commit fdac511
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10887,12 +10887,16 @@ a@
----
void sycl::free(void* ptr, const context& syclContext)
----
a@ Frees an allocation. The memory pointed to by [code]#ptr# must have been
allocated using one of the USM allocation routines. [code]#syclContext# must
be the same [code]#context# that was used to allocate the memory. The memory
is freed without waiting for <<command, commands>> operating on it to be
completed. If <<command, commands>> that use this memory are in-progress or
are enqueued the behavior is undefined.
a@ Frees an allocation.
The memory pointed to by [code]#ptr# must have been allocated using one of the
USM allocation routines or it must be a null pointer.
If [code]#ptr# is not null, the [code]#syclContext# must be the same
[code]#context# that was used to allocate the memory.
If [code]#ptr# is null, this function has no effect.
Otherwise, the memory is freed without waiting for <<command, commands>>
operating on it to be completed.
If <<command, commands>> that use this memory are in-progress or are enqueued,
the behavior is undefined.

a@
[source]
Expand Down

0 comments on commit fdac511

Please sign in to comment.