@ -54,8 +54,8 @@ void UpdateHeapStatisticsArrayBuffer(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args ) ;
Environment * env = Environment : : GetCurrent ( args ) ;
HeapStatistics s ;
HeapStatistics s ;
env - > isolate ( ) - > GetHeapStatistics ( & s ) ;
env - > isolate ( ) - > GetHeapStatistics ( & s ) ;
uint32_t * const buffer = env - > heap_statistics_buffer ( ) ;
double * const buffer = env - > heap_statistics_buffer ( ) ;
# define V(index, name, _) buffer[index] = static_cast<uint32_t >(s.name());
# define V(index, name, _) buffer[index] = static_cast<double >(s.name());
HEAP_STATISTICS_PROPERTIES ( V )
HEAP_STATISTICS_PROPERTIES ( V )
# undef V
# undef V
}
}
@ -65,13 +65,13 @@ void UpdateHeapSpaceStatisticsBuffer(const FunctionCallbackInfo<Value>& args) {
Environment * env = Environment : : GetCurrent ( args ) ;
Environment * env = Environment : : GetCurrent ( args ) ;
HeapSpaceStatistics s ;
HeapSpaceStatistics s ;
Isolate * const isolate = env - > isolate ( ) ;
Isolate * const isolate = env - > isolate ( ) ;
uint32_t * buffer = env - > heap_space_statistics_buffer ( ) ;
double * buffer = env - > heap_space_statistics_buffer ( ) ;
for ( size_t i = 0 ; i < number_of_heap_spaces ; i + + ) {
for ( size_t i = 0 ; i < number_of_heap_spaces ; i + + ) {
isolate - > GetHeapSpaceStatistics ( & s , i ) ;
isolate - > GetHeapSpaceStatistics ( & s , i ) ;
size_t const property_offset = i * kHeapSpaceStatisticsPropertiesCount ;
size_t const property_offset = i * kHeapSpaceStatisticsPropertiesCount ;
# define V(index, name, _) buffer[property_offset + index] = \
# define V(index, name, _) buffer[property_offset + index] = \
static_cast < uint32_t > ( s . name ( ) ) ;
static_cast < double > ( s . name ( ) ) ;
HEAP_SPACE_STATISTICS_PROPERTIES ( V )
HEAP_SPACE_STATISTICS_PROPERTIES ( V )
# undef V
# undef V
}
}
@ -100,7 +100,7 @@ void InitializeV8Bindings(Local<Object> target,
" updateHeapStatisticsArrayBuffer " ,
" updateHeapStatisticsArrayBuffer " ,
UpdateHeapStatisticsArrayBuffer ) ;
UpdateHeapStatisticsArrayBuffer ) ;
env - > set_heap_statistics_buffer ( new uint32_t [ kHeapStatisticsPropertiesCount ] ) ;
env - > set_heap_statistics_buffer ( new double [ kHeapStatisticsPropertiesCount ] ) ;
const size_t heap_statistics_buffer_byte_length =
const size_t heap_statistics_buffer_byte_length =
sizeof ( * env - > heap_statistics_buffer ( ) ) * kHeapStatisticsPropertiesCount ;
sizeof ( * env - > heap_statistics_buffer ( ) ) * kHeapStatisticsPropertiesCount ;
@ -146,7 +146,7 @@ void InitializeV8Bindings(Local<Object> target,
UpdateHeapSpaceStatisticsBuffer ) ;
UpdateHeapSpaceStatisticsBuffer ) ;
env - > set_heap_space_statistics_buffer (
env - > set_heap_space_statistics_buffer (
new uint32_t [ kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces ] ) ;
new double [ kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces ] ) ;
const size_t heap_space_statistics_buffer_byte_length =
const size_t heap_space_statistics_buffer_byte_length =
sizeof ( * env - > heap_space_statistics_buffer ( ) ) *
sizeof ( * env - > heap_space_statistics_buffer ( ) ) *