Skip to content

Commit f7b21b0

Browse files
committed
apparently macros are lowercase
1 parent e1ea91b commit f7b21b0

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

profiling/src/allocation.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ thread_local! {
127127
};
128128
}
129129

130-
macro_rules! TLS_ZEND_MM_STATE {
130+
macro_rules! tls_zend_mm_state {
131131
($x:ident) => {
132132
ZEND_MM_STATE.with(|cell| {
133133
let zend_mm_state = cell.get();
@@ -354,7 +354,7 @@ unsafe extern "C" fn alloc_prof_gc_mem_caches(
354354
if let Some(func) = GC_MEM_CACHES_HANDLER {
355355
if allocation_profiling {
356356
let heap = zend::zend_mm_get_heap();
357-
let (prepare, restore) = TLS_ZEND_MM_STATE!(prepare_restore_zend_heap);
357+
let (prepare, restore) = tls_zend_mm_state!(prepare_restore_zend_heap);
358358
let custom_heap = prepare(heap);
359359
func(execute_data, return_value);
360360
restore(heap, custom_heap);
@@ -370,7 +370,7 @@ unsafe extern "C" fn alloc_prof_malloc(len: size_t) -> *mut c_void {
370370
ALLOCATION_PROFILING_COUNT.fetch_add(1, SeqCst);
371371
ALLOCATION_PROFILING_SIZE.fetch_add(len as u64, SeqCst);
372372

373-
let ptr = TLS_ZEND_MM_STATE!(alloc)(len);
373+
let ptr = tls_zend_mm_state!(alloc)(len);
374374

375375
// during startup, minit, rinit, ... current_execute_data is null
376376
// we are only interested in allocations during userland operations
@@ -390,13 +390,13 @@ unsafe fn alloc_prof_prev_alloc(len: size_t) -> *mut c_void {
390390
// Safety: `ALLOCATION_PROFILING_ALLOC` will be initialised in
391391
// `alloc_prof_rinit()` and only point to this function when
392392
// `prev_custom_mm_alloc` is also initialised
393-
let alloc = TLS_ZEND_MM_STATE!(prev_custom_mm_alloc).unwrap();
393+
let alloc = tls_zend_mm_state!(prev_custom_mm_alloc).unwrap();
394394
alloc(len)
395395
}
396396

397397
unsafe fn alloc_prof_orig_alloc(len: size_t) -> *mut c_void {
398398
let heap = zend::zend_mm_get_heap();
399-
let (prepare, restore) = TLS_ZEND_MM_STATE!(prepare_restore_zend_heap);
399+
let (prepare, restore) = tls_zend_mm_state!(prepare_restore_zend_heap);
400400
let custom_heap = prepare(heap);
401401
let ptr: *mut c_void = zend::_zend_mm_alloc(heap, len);
402402
restore(heap, custom_heap);
@@ -408,14 +408,14 @@ unsafe fn alloc_prof_orig_alloc(len: size_t) -> *mut c_void {
408408
/// custom handlers won't be installed. We can not just point to the original
409409
/// `zend::_zend_mm_free()` as the function definitions differ.
410410
unsafe extern "C" fn alloc_prof_free(ptr: *mut c_void) {
411-
TLS_ZEND_MM_STATE!(free)(ptr);
411+
tls_zend_mm_state!(free)(ptr);
412412
}
413413

414414
unsafe fn alloc_prof_prev_free(ptr: *mut c_void) {
415415
// Safety: `ALLOCATION_PROFILING_FREE` will be initialised in
416416
// `alloc_prof_free()` and only point to this function when
417417
// `prev_custom_mm_free` is also initialised
418-
let free = TLS_ZEND_MM_STATE!(prev_custom_mm_free).unwrap();
418+
let free = tls_zend_mm_state!(prev_custom_mm_free).unwrap();
419419
free(ptr)
420420
}
421421

@@ -428,7 +428,7 @@ unsafe extern "C" fn alloc_prof_realloc(prev_ptr: *mut c_void, len: size_t) -> *
428428
ALLOCATION_PROFILING_COUNT.fetch_add(1, SeqCst);
429429
ALLOCATION_PROFILING_SIZE.fetch_add(len as u64, SeqCst);
430430

431-
let ptr = TLS_ZEND_MM_STATE!(realloc)(prev_ptr, len);
431+
let ptr = tls_zend_mm_state!(realloc)(prev_ptr, len);
432432

433433
// during startup, minit, rinit, ... current_execute_data is null
434434
// we are only interested in allocations during userland operations
@@ -448,13 +448,13 @@ unsafe fn alloc_prof_prev_realloc(prev_ptr: *mut c_void, len: size_t) -> *mut c_
448448
// Safety: `ALLOCATION_PROFILING_REALLOC` will be initialised in
449449
// `alloc_prof_realloc()` and only point to this function when
450450
// `prev_custom_mm_realloc` is also initialised
451-
let realloc = TLS_ZEND_MM_STATE!(prev_custom_mm_realloc).unwrap();
451+
let realloc = tls_zend_mm_state!(prev_custom_mm_realloc).unwrap();
452452
realloc(prev_ptr, len)
453453
}
454454

455455
unsafe fn alloc_prof_orig_realloc(prev_ptr: *mut c_void, len: size_t) -> *mut c_void {
456456
let heap = zend::zend_mm_get_heap();
457-
let (prepare, restore) = TLS_ZEND_MM_STATE!(prepare_restore_zend_heap);
457+
let (prepare, restore) = tls_zend_mm_state!(prepare_restore_zend_heap);
458458
let custom_heap = prepare(heap);
459459
let ptr: *mut c_void = zend::_zend_mm_realloc(heap, prev_ptr, len);
460460
restore(heap, custom_heap);

0 commit comments

Comments
 (0)