Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit35d1ebd

Browse files
colesburyDinoV
authored andcommitted
mimalloc: minimal changes for use in Python
- remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests
1 parentcb9ab74 commit35d1ebd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

‎Include/mimalloc/mimalloc/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ struct mi_heap_s {
524524
#defineMI_DEBUG_UNINIT (0xD0)
525525
#endif
526526
#if !defined(MI_DEBUG_FREED)
527-
#defineMI_DEBUG_FREED (0xDF)
527+
#defineMI_DEBUG_FREED (0xDD)
528528
#endif
529529
#if !defined(MI_DEBUG_PADDING)
530530
#defineMI_DEBUG_PADDING (0xDE)

‎Objects/mimalloc/alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static inline mi_segment_t* mi_checked_ptr_segment(const void* p, const char* ms
533533
mi_segment_t*constsegment=_mi_ptr_segment(p);
534534
mi_assert_internal(segment!=NULL);
535535

536-
#if (MI_DEBUG>0)
536+
#if0&&(MI_DEBUG>0)
537537
ifmi_unlikely(!mi_is_in_heap_region(p)) {
538538
#if (MI_INTPTR_SIZE==8&& defined(__linux__))
539539
if (((uintptr_t)p >>40)!=0x7F) {// linux tends to align large blocks above 0x7F000000000 (issue #640)

‎Objects/mimalloc/os.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ static void* mi_os_prim_alloc_aligned(size_t size, size_t alignment, bool commit
240240
}
241241
else {
242242
// if not aligned, free it, overallocate, and unmap around it
243-
_mi_warning_message("unable to allocate aligned OS memory directly, fall back to over-allocation (size: 0x%zx bytes, address: %p, alignment: 0x%zx, commit: %d)\n",size,p,alignment,commit);
243+
// NOTE(sgross): this warning causes issues in Python tests
244+
// _mi_warning_message("unable to allocate aligned OS memory directly, fall back to over-allocation (size: 0x%zx bytes, address: %p, alignment: 0x%zx, commit: %d)\n", size, p, alignment, commit);
244245
mi_os_prim_free(p,size,commit,stats);
245246
if (size >= (SIZE_MAX-alignment))returnNULL;// overflow
246247
constsize_tover_size=size+alignment;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp