Experimental Physics and Industrial Control System
> This means that the user code is *not* responsible for freeing
the
> memory, but the string library may do so itself when the next
string
> function is called that could change that string.
>
I have read similar things also.
> There *are* implementations of the C++ std::string API that use
> non-contiguous blocks
I can see that this would be possible, but they will of course
need to allocate a contiguous block and copy into it when c_str
is called, and we are full circle to the original premise which
was that the c_str() interface does not permit an implementation
based exclusively on memory management employing non-contiguous
fixed sized blocks.
Assuming that disembowelment of the basic_string supplied with
the default standard library in favor of an alternative
implementation was an approach we wanted to employ then admitedly
we need only be an unusually well disciplined code base, choosing
not to call the c_str() function, in order to reach fixed sized
non-contiguous nervana 8-)
Jeff
- References:
- Re: memory management Andrew Johnson
- Navigate by Date:
- Prev:
Re: memory management Benjamin Franksen
- Next:
RE: memory management Jeff Hill
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: memory management Andrew Johnson
- Next:
string implementations (was: memory management) Benjamin Franksen
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024