Git Product home page Git Product logo

nvwa's People

Contributors

adah1972 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvwa's Issues

debug_new 相关问题

vs2017环境
代码中定义实现了
new相关
1:void* operator new(size_t size);
2:void* operator new[](size_t size);
3:void* operator new(size_t size, const char* file, unsigned int line)
4:void* operator new[](size_t size, const char* file, unsigned int line)
delete相关
1:void operator delete(void* p);
2:void operator delete[](void* p);
3:void* operator new(size_t size, const char* file, unsigned int line);
4:void* operator new[](size_t size, const char* file, unsigned int line);

宏定义了 #define new new(FILE,LINE)
所以new or new[] 的时候都会调用new 3 api 或者new 4 api
请问一下delete 有啥办法能让代码中delete obj 或者 delete[] obj的时候 自动调用 delete 3 api或者delete 4 api

MinGW Bug

Hi. In MinGW i have errors. Don't know how it fix. Maybe you have some ideas?
Thank you!

In file included from C:\Code\nvwa/debug_new.h:42,
                 from C:\Code\DllMain.cpp:4:
C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/ext/new_allocator.h: In member function '_Tp* __gnu_cxx::new_allocator<_Tp>::allocate(__gnu_cxx::new_allocator<_Tp>::size_type, const void*)':
C:\Code\nvwa/_nvwa.h:57:14: error: expected operator before 'nvwa'
 #define NVWA nvwa
              ^~~~
In file included from C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/i686-w64-mingw32/bits/c++allocator.h:33,
                 from C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/bits/allocator.h:46,
                 from C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/string:41,
                 from C:\Code\MMM.h:3,
                 from C:\Code\DllMain.cpp:6:
C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/ext/new_allocator.h:111:37: error: expected ')' before 'nvwa'
  return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
                                     ^
                                     )
C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/ext/new_allocator.h:111:37: error: expected ';' before 'nvwa'
  return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
                                     ^
                                     ;
C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/ext/new_allocator.h:111:60: error: expected type-specifier before ')' token
  return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
                                                            ^
In file included from C:\Code\nvwa/debug_new.h:42,
                 from C:\Code\DllMain.cpp:4:
C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/bits/stl_tempbuf.h: In function 'std::pair<_Tp*, int> std::get_temporary_buffer(std::ptrdiff_t)':
C:\Code\nvwa/_nvwa.h:57:14: error: expected operator before 'nvwa'
 #define NVWA nvwa
              ^~~~
In file included from C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/memory:66,
                 from C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/thread:39,
                 from C:\Code\MMM.h:4,
                 from C:\Code\DllMain.cpp:6:
C:/mingw/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/bits/stl_tempbuf.h:94:45: error: expected ')' before 'nvwa'
    _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
                                             ^
                                             )
#ifdef _DEBUG
   #include "nvwa/debug_new.h"
#endif

// On Init
#ifdef _DEBUG
	fopen_s(&nvwa::new_output_fp, "c:\\tools\\leak.txt" , "w");
	nvwa::new_autocheck_flag = false;
	nvwa::new_verbose_flag = true;
#endif

// On destroy
#ifdef _DEBUG
	nvwa::check_leaks();
#endif

Thousands of leaked objects from Dynamic Library?

Hello,

I am using debug_new.h for verifying memory leaks in a program of mine; and there were 2317 reported! with the message that was something like:

Leaked object at 0x7facced07e20 (size 48, 0x104c62c31)

After all those, a message said

*** 2317 leaks found

and then, I get 1642 messages saying

delete: freed 0x7facced38e00 (size 112, 115248 bytes still allocated)

So, I started looking for the source of leakage, and it seems to come from a Dynamic Library I am using. Since it is a closed API, I cannot really debug it. Is this normal behavior?

Any advice? I am not an advanced programmer, an I am not even sure what is going on.

Thanks!

Overloading new/delete is not working in MinGW

Probably it is not a nvwa problem. But nvwa affects too. So I hope you can help me.

In MinGW application operators new/delete will not be replaced globally. So can't be catched new/delete calls in shared libraries (.dll). new/delete overloading applies only for application .exe file. I tried to ask this on StackOverflow but don't get answer.

fc_queue疑问

您好 请教下 fc_queue之前的老接口是咋保证两个线程访问安全的?没太看懂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.