memory.hh

Go to the documentation of this file.
1 
6 #ifndef memory_hh
7 #define memory_hh
8 
9 namespace concepts {
10 
16  template<class F>
17  inline F* newField(uint nr) {
18 #if defined(__SUNPRO_CC) || defined(__INTEL_COMPILER)
19  return (F*)std::malloc(nr*sizeof(F));
20 #elif defined(__GNUC__)
21 #if __GNUC__ > 3 || __GNUC__ > 2 && __GNUC_MINOR__ > 3
22  return (F*)std::malloc(nr*sizeof(F));
23 #else
24  return new (F)[nr];
25 #endif
26 #else
27  return new (F)[nr];
28 #endif
29  }
30 
31 } // namespace concepts {
32 
33 #endif // memory_hh
F * newField(uint nr)
Reserve memory for a field of type F and returns the pointer to first entrance.
Definition: memory.hh:17
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich