Thread: Interlocked refcounting and possible crash

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    I would avoid Borland C++. It is obviously not very good compared to other free compilers (such as GCC and Visual C++ which both have C++0x support).
    You are right, but I am very used to it, and I am slowly getting used to the others. C++0x Support in GCC - GNU Project - Free Software Foundation (FSF)
    and it hasn't full C++0x support.

    Why not just put the critical section and ref count inside the pointer class itself
    Ref count inside object does not require additional heap operations.
    Always 1 critical section per critical data, especially when I want to make a lot of pointers.
    Additionally, making this class virtual avoids deleting pointers of incomplete types (resulting in undefined behaviour) that I have already encountered.

    why you would want to use a class for this special purposes at all?
    I want to have a pure and widely used garbage collector. Boost's implementation has a couple of things that annoy me or I just dont need.

    Because it seemed the class did little--if anything--good
    That's exactly what I need and will help me a lot
    Last edited by kmdv; 08-01-2010 at 09:55 AM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by kmdv View Post
    You are right, but I am very used to it, and I am slowly getting used to the others. C++0x Support in GCC - GNU Project - Free Software Foundation (FSF)
    and it hasn't full C++0x support.
    But like you see, it's slowly getting there
    So why not start using them?

    As for the rest... I didn't question your need for a smart pointer. I questioned the need for wrapping your critical section in a make_threaded class.
    Those might have been better put in the Block of your smart pointer class and handled from there, because it seems that your make_threaded class provides no additional benefits.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    Those might have been better put in the Block of your smart pointer class and handled from there, because it seems that your make_threaded class provides no additional benefits.
    I was so lost in thoughts that I forgot about my previous problem. Of course adding critical section to block is the only way to do it, otherwise I would access section which does not exist.. thanks.

Popular pages Recent additions subscribe to a feed

Tags for this Thread