int top_format_length = StrLength(top_address_format) - 2;
for (uint16_t i = 0; i < Top::k_top_address_count; ++i) {
const char* address_name = AddressNames[i];
Vector<char> name =
Vector<char>::New(top_format_length + StrLength(address_name)
+ 1);
const char* chars = name.start();
OS::SNPrintF(name, top_address_format, address_name);
Add(Top::get_address_from_id((Top::AddressId)i), TOP_ADDRESS, i,
chars);
}
allocates a new Vector each loop iteration, shouldn't it call Dispose
() method on "name" to release the allocated memory at the end of the
for loop?
where do you release the allocated object? I didn't find a code that
releases it.
and when you allocate an ExternalReferenceTable object (in the same
file - serialize.cc):
static ExternalReferenceTable* instance() {
if (!instance_) instance_ = new ExternalReferenceTable();
return instance_;
}
where do you release the allocated object? I didn't find a code that
releases it.
On Jan 13, 12:26 pm, abc user <junk....@gmail.com> wrote:
> The following code in serialize.cc:
>
> int top_format_length = StrLength(top_address_format) - 2;
> for (uint16_t i = 0; i < Top::k_top_address_count; ++i) {
> const char* address_name = AddressNames[i];
> Vector<char> name =
> Vector<char>::New(top_format_length + StrLength(address_name)
> + 1);
> const char* chars = name.start();
> OS::SNPrintF(name, top_address_format, address_name);
> Add(Top::get_address_from_id((Top::AddressId)i), TOP_ADDRESS, i,
> chars);
> }
>
> allocates a new Vector each loop iteration, shouldn't it call Dispose
> () method on "name" to release the allocated memory at the end of the
> for loop?
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
On Jan 13, 12:39 pm, Erik Corry <erik.co...@gmail.com> wrote:
> 2010/1/13 abc user <junk....@gmail.com>
ok .. but I'm changing the v8 code to a thread-safe code with
intention to use it in a server application, and that would be a
problem if each v8 instance will leave some unreleased memory.