Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.06 KB

allocators.rst

File metadata and controls

29 lines (22 loc) · 1.06 KB

C API: Allocators

The fundamental concept for accessing memory through Umpire is an umpire:Allocator. In C, this means using the type umpire_allocator. There are corresponding functions that take an umpire_allocator and let you allocate and deallocate memory.

As with the native C++ interface, all allocators are accessed via the umpire::ResourceManager. In the C API, there is a corresponding umpire_resourcemanager type. To get an umpire_allocator:

../../../../examples/tutorial/c/tut_allocator.c

Once you have an umpire_allocator, you can use it to allocate and deallocate memory:

../../../../examples/tutorial/c/tut_allocator.c

In the next section, we will see how to allocate memory in different places.