Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Bin memory Management of Aerospike-column memory Management

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Memory request function call

Write_master- > write_master_dim- > write_master_bin_ops

-> write_master_bin_ops_loop- > as_bin_particle_alloc_from_client:

This function requests memory from as_bin_s- > particle and load the relevant bin attributes and values to the

In the requested memory.

2. Memory release function call

As_record_done- > as_record_destroy- > as_record_clean_bins

-> as_record_clean_bins_from

Click (here) to collapse or open

Void as_record_clean_bins_from (as_storage_rd * rd, uint16_t from)

{

For (uint16_t I = from; in _ bins; iTunes +) {

/ / release for each bin

As_bin * b = & rd- > bins [I]

If (as_bin_inuse (b)) {/ / bin state is valid

As_bin_particle_destroy (b, rd- > ns- > storage_data_in_memory)

As_bin_set_empty (b); / / sets the status AS_BIN_STATE_UNUSED of bin

}

}

}

Void as_bin_particle_destroy (as_bin * b, bool free_particle)

{

If (as_bin_is_embedded_particle (b)) {

B-> particle = 0. There is no room for application for the types of set and float. You can do so here.

}

Else if (b-> particle) {

If (free_particle) {

Particle_ vTable [as _ bin_get_particle_type (b)]-> destructor_fn (b-> particle)

}

/ / call the destructor function according to the type. Blob calls blob_destruct, which is actually cf_free (p).

/ / Free the space and set it to 0

B-> particle = 0

}

}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report