Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1919 closed Bugs (fixed)

Default constructed circular buffer throws std::bad_alloc

Reported by: Dean Michael Berris Owned by: Jan Gaspar
Milestone: Component: circular_buffer
Version: Boost 1.35.0 Severity: Showstopper
Keywords: circular_buffer, bad_alloc Cc:

Description

When a circular buffer is default constructed, it causes an allocation that's very large causing usually a bad allocation error when using the standard allocator(s).

A proposed change is to make the default constructor instead set the capacity to 0.

Attachments (1)

boost-circular-buffer-default-constructor-patch.diff (440 bytes ) - added by Dean Michael Berris 14 years ago.
Patch to set the default size when default constructed to 0.

Download all attachments as: .zip

Change History (3)

by Dean Michael Berris, 14 years ago

Patch to set the default size when default constructed to 0.

comment:1 by Jan Gaspar, 14 years ago

Resolution: fixed
Status: newclosed

comment:2 by (none), 14 years ago

Milestone: Boost 1.35.1

Milestone Boost 1.35.1 deleted

Note: See TracTickets for help on using tickets.