AGX Dynamics  2.37.3.2
ThreadLocalAllocator.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 
18 #pragma once
19 
20 #include <cstddef>
21 #include <agx/agxCore_export.h>
22 
23 namespace agx
24 {
25  class Container;
26 
28  {
29  public:
34 
35  ThreadLocalAllocator& operator=(const ThreadLocalAllocator& other);
36  ThreadLocalAllocator& operator=(ThreadLocalAllocator&& other);
37 
38 
39  void setContainer(Container* container);
40  void* allocateBytes(size_t numBytes);
41  void deallocateBytes(void* buffer, size_t numBytes);
42 
43  private:
44  void clear();
45 
46  private:
47  // m_container is not a salient attribute. It represents an owned-by
48  // relationship that should reflect the physical composition and
49  // copying/moving containers should not "leak" this pointer into the new
50  // container.
51  Container* m_container;
52  };
53 }
AGXTERRAIN_EXPORT void clear()
The Container is the base class for several of the container classes proided by AGX, such as agx::Vector and agx::HashSet.
Definition: Container.h:34
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
#define AGXCORE_EXPORT