Re: [protobuf] When calling the ExtractSubrange function, do I have to release the memory of the extracted List?

2019-03-19 Thread 윤석영
What I want to do is to delete the element from RepeatedField. I hope the 
memory of the exported element is released at the same time.

According to your answer, if I call the ExtractSubrange function with the 
null pointer parameter, how can I release the memory for the extracted 
element? Will memory leakage occur until RepieldField is destroyed?

If so, should I call a function other than the ExtractSubrange function to 
perform the operation I want?


2019년 2월 27일 수요일 오전 2시 33분 2초 UTC+9, Adam Cozzette 님의 말:
>
> I'm not really sure what you're trying to do. You can pass a null pointer 
> for the elements parameter and that will have the effect of just removing 
> elements from the repeated field, but ultimately the memory won't be 
> released until the RepeatedField is destroyed.
>
> On Tue, Feb 26, 2019 at 1:27 AM 윤석영 > 
> wrote:
>
>> Thank you for your answer. 
>> So, If I want to just release the memory, Is there nothing I have to 
>> except to assign null pointer for elements argument ? 
>>
>> 2019년 2월 1일 금요일 오전 4시 11분 6초 UTC+9, Adam Cozzette 님의 말:
>>>
>>> ExtractSubrange will just copy the values into an array that you 
>>> provide, so it's up to you how you want to manage that memory.
>>>
>>> On Thu, Jan 31, 2019 at 4:19 AM 윤석영  wrote:
>>>
 Hello,

 I have a question about ExtractSubrange.

 When calling the ExtractSubrange function, do I have to release the 
 memory of the extracted List?

 void RepeatedField::ExtractSubrange(
 int start,
 int num,
 Element * elements)

 if I have to do, when elements is NULL, how can I do it. 


 Thank you

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Protocol Buffers" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to protobuf+u...@googlegroups.com.
 To post to this group, send email to prot...@googlegroups.com.
 Visit this group at https://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to protobuf+u...@googlegroups.com .
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] When calling the ExtractSubrange function, do I have to release the memory of the extracted List?

2019-02-26 Thread 'Adam Cozzette' via Protocol Buffers
I'm not really sure what you're trying to do. You can pass a null pointer
for the elements parameter and that will have the effect of just removing
elements from the repeated field, but ultimately the memory won't be
released until the RepeatedField is destroyed.

On Tue, Feb 26, 2019 at 1:27 AM 윤석영  wrote:

> Thank you for your answer.
> So, If I want to just release the memory, Is there nothing I have to
> except to assign null pointer for elements argument ?
>
> 2019년 2월 1일 금요일 오전 4시 11분 6초 UTC+9, Adam Cozzette 님의 말:
>>
>> ExtractSubrange will just copy the values into an array that you provide,
>> so it's up to you how you want to manage that memory.
>>
>> On Thu, Jan 31, 2019 at 4:19 AM 윤석영  wrote:
>>
>>> Hello,
>>>
>>> I have a question about ExtractSubrange.
>>>
>>> When calling the ExtractSubrange function, do I have to release the
>>> memory of the extracted List?
>>>
>>> void RepeatedField::ExtractSubrange(
>>> int start,
>>> int num,
>>> Element * elements)
>>>
>>> if I have to do, when elements is NULL, how can I do it.
>>>
>>>
>>> Thank you
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Protocol Buffers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to protobuf+u...@googlegroups.com.
>>> To post to this group, send email to prot...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] When calling the ExtractSubrange function, do I have to release the memory of the extracted List?

2019-02-26 Thread 윤석영
Thank you for your answer. 
So, If I want to just release the memory, Is there nothing I have to except 
to assign null pointer for elements argument ? 

2019년 2월 1일 금요일 오전 4시 11분 6초 UTC+9, Adam Cozzette 님의 말:
>
> ExtractSubrange will just copy the values into an array that you provide, 
> so it's up to you how you want to manage that memory.
>
> On Thu, Jan 31, 2019 at 4:19 AM 윤석영 > 
> wrote:
>
>> Hello,
>>
>> I have a question about ExtractSubrange.
>>
>> When calling the ExtractSubrange function, do I have to release the 
>> memory of the extracted List?
>>
>> void RepeatedField::ExtractSubrange(
>> int start,
>> int num,
>> Element * elements)
>>
>> if I have to do, when elements is NULL, how can I do it. 
>>
>>
>> Thank you
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to protobuf+u...@googlegroups.com .
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] When calling the ExtractSubrange function, do I have to release the memory of the extracted List?

2019-01-31 Thread 'Adam Cozzette' via Protocol Buffers
ExtractSubrange will just copy the values into an array that you provide,
so it's up to you how you want to manage that memory.

On Thu, Jan 31, 2019 at 4:19 AM 윤석영  wrote:

> Hello,
>
> I have a question about ExtractSubrange.
>
> When calling the ExtractSubrange function, do I have to release the memory
> of the extracted List?
>
> void RepeatedField::ExtractSubrange(
> int start,
> int num,
> Element * elements)
>
> if I have to do, when elements is NULL, how can I do it.
>
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.