@@ -35,9 +35,10 @@ namespace boost { namespace stacktrace {
3535template <class Allocator >
3636class basic_stacktrace {
3737 std::vector<frame, Allocator> impl_;
38+ typedef boost::stacktrace::detail::native_frame_ptr_t native_frame_ptr_t ;
3839
3940 // / @cond
40- void fill (void * * begin, std::size_t size) {
41+ void fill (native_frame_ptr_t * begin, std::size_t size) {
4142 if (!size) {
4243 return ;
4344 }
@@ -54,7 +55,7 @@ class basic_stacktrace {
5455 }
5556
5657 static std::size_t frames_count_from_buffer_size (std::size_t buffer_size) BOOST_NOEXCEPT {
57- const std::size_t ret = (buffer_size > sizeof (void * ) ? buffer_size / sizeof (void * ) : 0 );
58+ const std::size_t ret = (buffer_size > sizeof (native_frame_ptr_t ) ? buffer_size / sizeof (native_frame_ptr_t ) : 0 );
5859 return (ret > 1024 ? 1024 : ret); // Dealing with suspiciously big sizes
5960 }
6061
@@ -66,7 +67,7 @@ class basic_stacktrace {
6667
6768 try {
6869 { // Fast path without additional allocations
69- void * buffer[buffer_size];
70+ native_frame_ptr_t buffer[buffer_size];
7071 const std::size_t frames_count = boost::stacktrace::detail::this_thread_frames::collect (buffer, buffer_size, frames_to_skip + 1 );
7172 if (buffer_size > frames_count || frames_count >= max_depth) {
7273 const std::size_t size = (max_depth < frames_count ? max_depth : frames_count);
@@ -76,8 +77,8 @@ class basic_stacktrace {
7677 }
7778
7879 // Failed to fit in `buffer_size`. Allocating memory:
79- typedef typename Allocator::template rebind<void * >::other allocator_void_t ;
80- std::vector<void * , allocator_void_t > buf (buffer_size * 2 , 0 , impl_.get_allocator ());
80+ typedef typename Allocator::template rebind<native_frame_ptr_t >::other allocator_void_t ;
81+ std::vector<native_frame_ptr_t , allocator_void_t > buf (buffer_size * 2 , 0 , impl_.get_allocator ());
8182 do {
8283 const std::size_t frames_count = boost::stacktrace::detail::this_thread_frames::collect (buf.data (), buf.size (), frames_to_skip + 1 );
8384 if (buf.size () > frames_count || frames_count >= max_depth) {
@@ -284,7 +285,7 @@ class basic_stacktrace {
284285 return ret;
285286 }
286287
287- void * ptr = 0 ;
288+ native_frame_ptr_t ptr = 0 ;
288289 ret.impl_ .reserve (frames_count);
289290 while (in.read (reinterpret_cast <Char*>(&ptr), sizeof (ptr))) {
290291 if (!ptr) {
@@ -302,13 +303,13 @@ class basic_stacktrace {
302303 // / @b Complexity: O(size) in worst case
303304 static basic_stacktrace from_dump (const void * begin, std::size_t size, const allocator_type& a = allocator_type()) {
304305 basic_stacktrace ret (0 , 0 , a);
305- const void * const * first = static_cast <const void * const *>(begin);
306+ const native_frame_ptr_t * first = static_cast <const native_frame_ptr_t *>(begin);
306307 const std::size_t frames_count = frames_count_from_buffer_size (size);
307308 if (!frames_count) {
308309 return ret;
309310 }
310311
311- const void * const * const last = first + frames_count;
312+ const native_frame_ptr_t * const last = first + frames_count;
312313 ret.impl_ .reserve (frames_count);
313314 for (; first != last; ++first) {
314315 if (!*first) {
0 commit comments