[ 
https://issues.apache.org/jira/browse/THRIFT-5093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christopher Friedt updated THRIFT-5093:
---------------------------------------
    Description: 
My main use case for {{TMemoryBuffer}} was that I wanted to be able to call 
{{resetBuffer()}} on {{OBSERVE}} buffers and reuse the contents for test cases 
over and over. While the default {{resetBuffer()}} cannot be used for that 
purpose, the same result can be achieved by calling {{resetBuffer(ro_mem, 
ro_mem_size, OBSERVE)}} as well, so the workaround is fairly trivial.

While the former implementation would be more convenient in some cases, it 
makes more sense to have consistent behaviour for all {{resetBuffer()}} 
implementations.

Added test cases to clarify the effect of {{MemoryPolicy}} on {{TMemoryBuffer}} 
behaviour.

  was:
My main use case with the original code change was that I wanted to be able to 
call {{resetBuffer()}} on {{OBSERVE}} buffers and reuse the contents for test 
cases over and over. While the default {{resetBuffer()}} cannot be used for 
that purpose, the same result can be achieved by calling {{resetBuffer(ro_mem, 
ro_mem_size, OBSERVE)}} as well, so the workaround is fairly trivial.

While the former implementation would be more convenient in some cases, it 
makes more sense to have consistent behaviour for all {{resetBuffer()}} 
implementations.

Added test cases to clarify the effect of {{MemoryPolicy}} on {{TMemoryBuffer}} 
behaviour.


> TMemoryBuffer: add test cases to clarify behaviour of MemoryPolicy
> ------------------------------------------------------------------
>
>                 Key: THRIFT-5093
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5093
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.17.0
>            Reporter: Christopher Friedt
>            Priority: Minor
>          Time Spent: 7h 50m
>  Remaining Estimate: 0h
>
> My main use case for {{TMemoryBuffer}} was that I wanted to be able to call 
> {{resetBuffer()}} on {{OBSERVE}} buffers and reuse the contents for test 
> cases over and over. While the default {{resetBuffer()}} cannot be used for 
> that purpose, the same result can be achieved by calling 
> {{resetBuffer(ro_mem, ro_mem_size, OBSERVE)}} as well, so the workaround is 
> fairly trivial.
> While the former implementation would be more convenient in some cases, it 
> makes more sense to have consistent behaviour for all {{resetBuffer()}} 
> implementations.
> Added test cases to clarify the effect of {{MemoryPolicy}} on 
> {{TMemoryBuffer}} behaviour.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to