Opened 7 years ago
Last modified 7 years ago
#11414 new Bugs
minor problem in libs/pool/example/sys_allocator.hpp
Reported by: | Owned by: | Chris Newbold | |
---|---|---|---|
Milestone: | To Be Determined | Component: | pool |
Version: | Boost 1.57.0 | Severity: | Problem |
Keywords: | Cc: |
Description
In sys_allocator.hpp the struct new_delete_allocator has a minor issue.
The code is:
static pointer allocate(const size_type n, const void* = 0) { return (pointer) new char[n * sizeof(T)]; } static void deallocate(const pointer p, const size_type) { delete [] p; }
Note that the deallocate member function calls array delete, but the allocate function does not call array new. According to the standard this is invalid.
The HP NonStop runtime will generate an assert failure on the call to the delete.
Note:
See TracTickets
for help on using tickets.