User Profile

Collapse

Profile Sidebar

Collapse
51423benam
51423benam
Last Activity: Sep 28 '18, 11:43 AM
Joined: Apr 24 '18
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Portaudio wants a callback function pointer, but I have the data in a class

    Hello,

    I want to use portaudio for my c++ audio project. The problem is: As you can see here and here, it wants me to pass the callback function as a function argument of openDefaultStre am(). The problem is: The audio data lies in a class. So there is a object of the class AudioManager() which collects the newest samples. The problem is now: I can't pass a member function pointer to openDefaultStre am(), right? Since that would require...
    See more | Go to post

  • 51423benam
    replied to Vector at()
    in C
    So if I understand it correctly now: The reserve() still needs push_backs to fill the vector, but it takes care that the vector doesn't need to reallocate until I made 256 push_backs right?
    See more | Go to post

    Leave a comment:


  • 51423benam
    started a topic Vector at()
    in C

    Vector at()

    Hello,

    in my program I use vectors, and I get a segfault. I use gcc on windows 10 x64. I could reproduce it with a test file:
    Code:
    #include <iostream>
    #include <vector>
    
    using namespace std;
    
    int main()
    {
        cout << "Hello world!" << endl;
        std::vector<int> tvec = vector<int>();
        tvec.reserve(256);
    ...
    See more | Go to post

  • I know, that's what I said!
    See more | Go to post

    Leave a comment:


  • But the function returns true (not empty) when I can see in the debugger that it's empty. ):
    See more | Go to post

    Leave a comment:


  • std::queue::empty() returns true but the size() is -1

    Hello,

    I have a std::queue I am pushing and popping items to / from. A output threads constantly ask for the oldest buffer (on queue::front()) . I wrote a safety function that checks if the queue is not empty, and another function which calls that functions, and thus, if the function returns true (queue is not empty), return front() of the queue, and if the function returns false (queue is empty) it should return a zero-constructed...
    See more | Go to post

  • 51423benam
    replied to C++ find dangling pointer deletion
    in C
    I don't think so, the warnings are spread all over blender. But the problem is, the whitelist docs for dr. Memory are a bit... bot that detailed. It would be cool if I could whitelist only one file. Of course, I can suppress all other error types too, vut there seem to be still many uninitialized accesses or at least many possibilities for them.
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ find dangling pointer deletion
    in C
    Well, it seems to be working, but I clearly have to learn how to supress and whitelist errors, because it counts more than 2.000.000 just on Blender startup ��
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ find dangling pointer deletion
    in C
    I think I will try it with Dr. Memory or a similar tool which is windows compatible.
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ find dangling pointer deletion
    in C
    Can you explain it please a little bit more detailed? What do you mean with is this Android or Linux? And which emulators?
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ find dangling pointer deletion
    in C
    I just found that popular memory tools like asan (adress sanitizer) output the location where it is deleted. Now I only have to get one of those working on windows.
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ find dangling pointer deletion
    in C
    I know smart pointers, in fact, I am using them where I can already in my projects, but as I sad, this is work for an open-source software (Blender). So I can't really rewrite millions of lines of code to use smart pointers, I have to take the code as it is.
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ find dangling pointer deletion
    in C
    Read this, there it says that 0xDDDDDDDD means deallocated memory. https://www.softwareverify.com/memory-bit-patterns.php
    See more | Go to post

    Leave a comment:


  • 51423benam
    started a topic C++ find dangling pointer deletion
    in C

    C++ find dangling pointer deletion

    Hello!

    I am working on the source code of Blender and trying to contribute, mainly through bug fixes. Now I have a problem: I am using Visual Studio and Blender crashes because of a dangling pointer (value 0xDDDDDDDD). Now I want to find the place where it is deleted or freed. Are there tools or solutions for that? Most tools seem to only search for memory leaks and so on, those, which find dangling pointers, don't usually search the...
    See more | Go to post

  • 51423benam
    replied to Python Game making Help!?
    I would start with Pygame, but I don't have that much experience. The best tip I can give is: be patient. You won't immediately develop a fancy ego shooter or anything in 3d. You will start with simple 2d games.
    See more | Go to post

    Leave a comment:


  • Please ask more detailed.
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ template class pointer polymorphism
    in C
    Ah, I wanted to do your approach with the proxy, but I have a problem. Your example itself is nice, but my problem still exists. I need to call functions on that template object (or, in this case, the proxy) which return data types differ, depending on the template argument of the object. How can I solve this using the proxy pattern? By the way, the return values aren't primitive data types such as int or float which you can convert easily, it's...
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ template class pointer polymorphism
    in C
    Ok. Now I got another example working, now I'm trying it out on my main project. But do you think there is a way to integrate that proxy somehow in the base class including casting? Because another class adds not-much-doing-code.
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to beginner question about programming
    in C
    I wouldn't start with javascript, but python is good for beginners in my opinion.
    See more | Go to post

    Leave a comment:


  • 51423benam
    replied to C++ template class pointer polymorphism
    in C
    Ok now I don't know much about unions and variants, I think I just use the Proxy pattern in a way you posted above and then do casts whenever I want to call a non-baseclass function. I've calculated a little and figured out that shouldn't be a performance impact (audio sample rate of 44.100 hertz standard, buffer size 64 standard, makes only about 690 of this function calls per second). Can I just use static_cast for downcasting and then call the...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...