Click here to Skip to main content
15,503,369 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: C++ is love Pin
Rick York14-Dec-20 17:48
mveRick York14-Dec-20 17:48 
GeneralRe: C++ is love Pin
honey the codewitch14-Dec-20 18:07
mvahoney the codewitch14-Dec-20 18:07 
GeneralRe: C++ is love Pin
honey the codewitch14-Dec-20 18:01
mvahoney the codewitch14-Dec-20 18:01 
GeneralRe: C++ is love Pin
raddevus14-Dec-20 19:08
mvaraddevus14-Dec-20 19:08 
GeneralRe: C++ is love Pin
honey the codewitch14-Dec-20 19:17
mvahoney the codewitch14-Dec-20 19:17 
GeneralRe: C++ is love Pin
Member 1330167915-Dec-20 1:14
Member 1330167915-Dec-20 1:14 
GeneralRe: C++ is love Pin
honey the codewitch15-Dec-20 2:13
mvahoney the codewitch15-Dec-20 2:13 
GeneralRe: C++ is love Pin
Member 1330167915-Dec-20 3:12
Member 1330167915-Dec-20 3:12 
Not much improvement, just a few observations:

1. Identifiers starting with underscores are reserved. If you use them then your program is non-conforming for no good reason.

2. The comparison against capacity in both the static and dynamic classes result in never being able to use the last byte of the pool: The "used()>=capacity" should be "used()>capacity". To test it instantiate a pool of 10 bytes and allocate 6. The (capacity() - used()) is then 4, but a further allocation of 4 fails. A further allocation of 3, on the other hand, succeeds and (capacity() - used()) is then 1.

3. The static pool could benefit from a #warning directive when C is too large. Right now a 8MB C when instantiating it (1024 * 1024 * 8) would almost certainly overflow the stack, and 8MB is not a lot of memory.
GeneralRe: C++ is love Pin
honey the codewitch15-Dec-20 3:20
mvahoney the codewitch15-Dec-20 3:20 
GeneralRe: C++ is love Pin
Mladen Janković15-Dec-20 16:16
Mladen Janković15-Dec-20 16:16 
GeneralRe: C++ is love Pin
Mladen Janković15-Dec-20 15:30
Mladen Janković15-Dec-20 15:30 
GeneralRe: C++ is love Pin
honey the codewitch15-Dec-20 15:36
mvahoney the codewitch15-Dec-20 15:36 
GeneralRe: C++ is love Pin
Mladen Janković15-Dec-20 15:46
Mladen Janković15-Dec-20 15:46 
GeneralRe: C++ is love Pin
honey the codewitch15-Dec-20 18:06
mvahoney the codewitch15-Dec-20 18:06 
GeneralRe: C++ is love Pin
Mladen Janković16-Dec-20 2:28
Mladen Janković16-Dec-20 2:28 
GeneralRe: C++ is love Pin
Mladen Janković15-Dec-20 16:04
Mladen Janković15-Dec-20 16:04 
GeneralRe: C++ is love Pin
honey the codewitch15-Dec-20 18:07
mvahoney the codewitch15-Dec-20 18:07 
GeneralRe: C++ is love Pin
Mladen Janković16-Dec-20 1:27
Mladen Janković16-Dec-20 1:27 
GeneralRe: C++ is love Pin
honey the codewitch16-Dec-20 1:32
mvahoney the codewitch16-Dec-20 1:32 
GeneralRe: C++ is love Pin
Mladen Janković16-Dec-20 2:13
Mladen Janković16-Dec-20 2:13 
GeneralRe: C++ is love Pin
honey the codewitch16-Dec-20 2:19
mvahoney the codewitch16-Dec-20 2:19 
JokeRe: C++ is love Pin
Slacker00714-Dec-20 11:33
professionalSlacker00714-Dec-20 11:33 
GeneralRe: C++ is love Pin
honey the codewitch14-Dec-20 18:08
mvahoney the codewitch14-Dec-20 18:08 
GeneralRe: C++ is love Pin
den2k8814-Dec-20 22:48
professionalden2k8814-Dec-20 22:48 
GeneralRe: C++ is love Pin
Slacker00715-Dec-20 0:02
professionalSlacker00715-Dec-20 0:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

How would you describe your current job?
Fighting dragons everyday or clicking the same boxes on the same forms, day after day?
  Results   374 votes