Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    [melange] Static initialization order fiasco

    Scheduled Pinned Locked Moved Bugs
    5 Posts 0 Posters 984 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 19/12/2012 at 18:56, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi fellow developers,

      I have bound the _melange_ memory allocation functions to a custom memory manager initialized only after the program have reached WinMain().

      In Release mode only, it seems that _melange_ use some kinf of CRT instructions to init the inner structure _melange_::InitStrings, whose constructor calls _melange_::InitStrings::InitStrings().

      It leads to two calls to _melange_::MemAlloc(VLONG), each one trying to allocate 131072 bytes before I even get the chance to execute a line of my code.

      I've found a workaround to prevent my allocator for crashing but it's not efficient nor elegant.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 20/12/2012 at 06:37, xxxxxxxx wrote:

        Hi,

        we've changed the InitStrings() to use only static memory so there should be no more memory allocation before your memory management is initialized.
        Please check with the next upcoming Melange version (I guess it will be released around the second week of january 2013).

        Thank you for pointing out this issue!
        Cheers,
        Jens

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 20/12/2012 at 14:09, xxxxxxxx wrote:

          Thank you for your quick answer. I look forward to the next released build !

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 14/01/2013 at 11:53, xxxxxxxx wrote:

            Hi,

            the new Melange v5.1 version (#70290) is available for download now:
            http://www.maxon.net/support/developer-support.html

            Cheers,
            Jens

            changes since #68456:
            - IDs for XmbSubSurface shader added
            - fix when custom memory management is used (InitStrings() do not allocate memory anymore)
            - print out polygon selection data (commandline tool)
            - fix mem leak in GeExecute (StartRenderServer) (OSX only)
            - small fixes in renderconnection example
            - fix when parsing argument list of GeExecute() (OSX only)
            - fix GeGetTimer() (OSX only)
            - win libs vs2012 update 1 compiled

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 21/01/2013 at 14:42, xxxxxxxx wrote:

              Whoo that was fast, good work ! I'll use this new build in no time !

              By the way, the Developer support page where the Melange library can be downloaded still states that the current build is the #68456  one Tongue

              1 Reply Last reply Reply Quote 0
              • First post
                Last post