Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22104

Why was the implement of __pool_alloc_base in gcc/libstdc++-v3/src/c++98/pool_allocator.cc?

$
0
0

when I read pool_allocator in STL, I found that many functions of the __pool_alloc_base class are implemented in gcc/libstdc++-v3/src/c++98/pool_allocator.cc, why is that designed? Why not put the implementation of these functions in the pool_allocator.h?

pool_allocator.h

class __pool_alloc_base {protected:    ...    _GLIBCXX_CONST _Obj *volatile *_M_get_free_list(size_t __bytes) throw();    __mutex & _M_get_mutex() throw();    // Returns an object of size __n, and optionally adds to size __n    // free list.    void *_M_refill(size_t __n);    // Allocates a chunk for nobjs of size size.  nobjs may be reduced    // if it is inconvenient to allocate the requested number.    char *_M_allocate_chunk(size_t __n, int &__nobjs);};

Viewing all articles
Browse latest Browse all 22104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>