~ubuntu-branches/ubuntu/utopic/libthrust/utopic

« back to all changes in this revision

Viewing changes to system/cpp/detail/malloc_and_free.h

  • Committer: Package Import Robot
  • Author(s): Andreas Beckmann
  • Date: 2013-07-10 12:57:33 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130710125733-my19jic71sqsabaj
Tags: 1.7.0-1
* New upstream release.  (Closes: #715362)
* Update watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <thrust/detail/config.h>
20
20
#include <thrust/detail/raw_pointer_cast.h>
21
21
#include <cstdlib> // for malloc & free
 
22
#include <thrust/system/cpp/detail/execution_policy.h>
22
23
 
23
24
namespace thrust
24
25
{
32
33
 
33
34
// note that malloc returns a raw pointer to avoid
34
35
// depending on the heavyweight thrust/system/cpp/memory.h header
35
 
inline void *malloc(tag, std::size_t n)
 
36
template<typename DerivedPolicy>
 
37
  void *malloc(execution_policy<DerivedPolicy> &, std::size_t n)
36
38
{
37
39
  return std::malloc(n);
38
40
} // end malloc()
39
41
 
40
42
 
41
 
template<typename Pointer>
42
 
inline void free(tag, Pointer ptr)
 
43
template<typename DerivedPolicy, typename Pointer>
 
44
  void free(execution_policy<DerivedPolicy> &, Pointer ptr)
43
45
{
44
46
  std::free(thrust::raw_pointer_cast(ptr));
45
47
} // end free()