+2015-11-10 Martin Liska <mliska@suse.cz>
+
+ * alloc-pool.h (allocate_raw): New function.
+ (operator new (size_t, object_allocator<T> &a)): Use the
+ function instead of object_allocator::allocate).
+
2015-11-10 Ilya Enkovich <enkovich.gnu@gmail.com>
* config/i386/sse.md (HALFMASKMODE): New attribute.
m_allocator.release_if_empty ();
}
+
+ /* Allocate memory for instance of type T and call a default constructor. */
+
inline T *
allocate () ATTRIBUTE_MALLOC
{
return ::new (m_allocator.allocate ()) T;
}
+ /* Allocate memory for instance of type T and return void * that
+ could be used in situations where a default constructor is not provided
+ by the class T. */
+
+ inline void *
+ allocate_raw () ATTRIBUTE_MALLOC
+ {
+ return m_allocator.allocate ();
+ }
+
inline void
remove (T *object)
{
inline void *
operator new (size_t, object_allocator<T> &a)
{
- return a.allocate ();
+ return a.allocate_raw ();
}
/* Hashtable mapping alloc_pool names to descriptors. */