MCPcopy Create free account
hub / github.com/dengwirda/jigsaw / reallocate

Method reallocate

src/libcpp/allocators/alloc_base.hpp:105–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104 __static_call
105 __inline_call char_type* reallocate (
106 char_type*_addr ,
107 size_type _old_count,
108 size_type _new_count
109 )
110 {
111 __unreferenced(_old_count) ;
112
113 /*---------------------- delegate to malloc & friends */
114 char_type* _nptr =
115 (char_type*)std::realloc(_addr,_new_count) ;
116
117 /*------------------------------ throw on alloc fails */
118 if ( _new_count != +0 &&
119 nullptr == _nptr )
120 throw std::bad_alloc ();
121
122 /*------------------------------ return memory buffer */
123 return ( _nptr ) ;
124 }
125
126 /*
127 --------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected