Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Professional C++, 3rd Edition
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional C++, 3rd Edition
This is the forum to discuss the Wrox book Professional C++, 3rd Edition by Marc Gregoire,; ISBN: 978-1-118-85805-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C++, 3rd Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 15th, 2017, 11:55 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Can't make 09_ConstructorError release already-allocated memory

I've been fiddling with the 09_ConstructorError example, changing the line

Matrix m(10, 10);
to use different widths and heights. What I've found is that I can't seem to make it act as it's supposed to, i.e. to allocate memory until allocation finally fails, and then delete[] all the previously-allocated 1-dimensional arrays and then exits with a bad_alloc exception. Instead, if I use small to moderate values for the matrix bounds, it just allocates successfully and exits normally; but if I set really high bounds, it exits with a SIGKILL, apparently without releasing any of the already-allocated arrays (I can tell because I've put some debug statements in the deallocation part).

I've tried this on Mac OS X and Linux, but not Windows. What am I doing wrong?

Last edited by echristopherson; May 15th, 2017 at 12:00 PM.. Reason: code tags
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Book release date and .NET Core release date Joakeim BOOK: Professional C# 6 and .NET Core 1.0 4 June 11th, 2016 01:25 PM
File release Jeremy.Carter Javascript How-To 2 May 27th, 2011 04:54 AM
Release problem jeusdi .NET Framework 1.x 0 February 27th, 2007 11:19 AM
Release date Daniel.K62 BOOK: Beginning C# 2005 Databases 2 October 30th, 2006 03:00 PM
Memory Release for SQL Server 2000 ajkulkarni SQL Server 2000 3 September 23rd, 2004 03:32 AM

All times are GMT -4. The time now is 10:46 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.