⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284895 in webkit


Ignore:
Timestamp:
Oct 26, 2021, 2:08:08 PM (5 years ago)
Author:
ddkilzer@apple.com
Message:

[libpas] Add printf format attributes
<https://webkit.org/b/232291>
<rdar://problem/84643135>

Reviewed by Yusuke Suzuki.

Define PAS_FORMAT_PRINTF() macro in pas_utils.h, apply it to
functions that take format strings, then fix all the issues
found during compilation.

These changes also let us remove the clang pragma macros that
ignored -Wformat-nonliteral warnings in pas_log.c and
pas_string_stream.c.

  • libpas/src/libpas/pas_all_heaps.c:

(verify_in_steady_state_segregated_directory_callback):

  • libpas/src/libpas/pas_bitfit_directory.c:

(pas_bitfit_directory_take_last_empty):

  • libpas/src/libpas/pas_bitfit_heap.c:

(pas_bitfit_heap_select_variant):

  • libpas/src/libpas/pas_bitfit_page_inlines.h:

(pas_bitfit_page_allocate):
(pas_bitfit_page_deallocate_with_page_impl):

  • libpas/src/libpas/pas_commit_span.c:

(pas_commit_span_construct):
(pas_commit_span_add_unchanged):

  • libpas/src/libpas/pas_enumerate_large_heaps.c:

(record_span):
(pas_enumerate_large_heaps):

  • libpas/src/libpas/pas_fd_stream.c:

(fd_stream_vprintf):

  • libpas/src/libpas/pas_fd_stream.h:
  • libpas/src/libpas/pas_hashtable.h:
  • libpas/src/libpas/pas_large_map.c:

(pas_large_map_add):
(pas_large_map_take):

  • libpas/src/libpas/pas_large_sharing_pool.c:

(validate_min_heap):

  • libpas/src/libpas/pas_local_allocator_inlines.h:

(pas_local_allocator_scan_bits_to_set_up_free_bits):
(pas_local_allocator_return_memory_to_page):
(pas_local_allocator_try_allocate_inline_cases):

  • libpas/src/libpas/pas_log.c:
  • libpas/src/libpas/pas_log.h:
  • libpas/src/libpas/pas_page_sharing_pool.c:

(pas_page_sharing_pool_add_at_index):

  • libpas/src/libpas/pas_segregated_directory_inlines.h:

(pas_segregated_directory_iterate_iterate_callback):
(pas_segregated_directory_iterate_forward):

  • libpas/src/libpas/pas_segregated_heap.c:

(pas_segregated_heap_ensure_size_directory_for_count):

  • libpas/src/libpas/pas_segregated_shared_page_directory.c:

(pas_segregated_shared_page_directory_find_first_eligible):

  • libpas/src/libpas/pas_segregated_shared_view.c:

(compute_summary):

  • libpas/src/libpas/pas_segregated_view.c:

(for_each_live_object):
(should_be_eligible):

  • libpas/src/libpas/pas_status_reporter.c:

(pas_status_reporter_dump_large_map):

  • libpas/src/libpas/pas_stream.h:
  • libpas/src/libpas/pas_string_stream.c:

(string_stream_vprintf):

  • libpas/src/libpas/pas_string_stream.h:
  • libpas/src/libpas/pas_thread_local_cache.c:

(suspend):

  • libpas/src/libpas/pas_tiny_large_map_entry.h:

(pas_tiny_large_map_entry_can_create):

  • libpas/src/libpas/pas_try_allocate_common.h:

(pas_try_allocate_common_impl_fast):
(pas_try_allocate_common_impl_slow):

  • libpas/src/libpas/pas_try_allocate_intrinsic.h:
  • libpas/src/libpas/pas_utils.h:
Location:
trunk/Source/bmalloc
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r284533 r284895  
     12021-10-26  David Kilzer  <ddkilzer@apple.com>
     2
     3        [libpas] Add printf format attributes
     4        <https://webkit.org/b/232291>
     5        <rdar://problem/84643135>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        Define PAS_FORMAT_PRINTF() macro in pas_utils.h, apply it to
     10        functions that take format strings, then fix all the issues
     11        found during compilation.
     12
     13        These changes also let us remove the clang pragma macros that
     14        ignored -Wformat-nonliteral warnings in pas_log.c and
     15        pas_string_stream.c.
     16
     17        * libpas/src/libpas/pas_all_heaps.c:
     18        (verify_in_steady_state_segregated_directory_callback):
     19        * libpas/src/libpas/pas_bitfit_directory.c:
     20        (pas_bitfit_directory_take_last_empty):
     21        * libpas/src/libpas/pas_bitfit_heap.c:
     22        (pas_bitfit_heap_select_variant):
     23        * libpas/src/libpas/pas_bitfit_page_inlines.h:
     24        (pas_bitfit_page_allocate):
     25        (pas_bitfit_page_deallocate_with_page_impl):
     26        * libpas/src/libpas/pas_commit_span.c:
     27        (pas_commit_span_construct):
     28        (pas_commit_span_add_unchanged):
     29        * libpas/src/libpas/pas_enumerate_large_heaps.c:
     30        (record_span):
     31        (pas_enumerate_large_heaps):
     32        * libpas/src/libpas/pas_fd_stream.c:
     33        (fd_stream_vprintf):
     34        * libpas/src/libpas/pas_fd_stream.h:
     35        * libpas/src/libpas/pas_hashtable.h:
     36        * libpas/src/libpas/pas_large_map.c:
     37        (pas_large_map_add):
     38        (pas_large_map_take):
     39        * libpas/src/libpas/pas_large_sharing_pool.c:
     40        (validate_min_heap):
     41        * libpas/src/libpas/pas_local_allocator_inlines.h:
     42        (pas_local_allocator_scan_bits_to_set_up_free_bits):
     43        (pas_local_allocator_return_memory_to_page):
     44        (pas_local_allocator_try_allocate_inline_cases):
     45        * libpas/src/libpas/pas_log.c:
     46        * libpas/src/libpas/pas_log.h:
     47        * libpas/src/libpas/pas_page_sharing_pool.c:
     48        (pas_page_sharing_pool_add_at_index):
     49        * libpas/src/libpas/pas_segregated_directory_inlines.h:
     50        (pas_segregated_directory_iterate_iterate_callback):
     51        (pas_segregated_directory_iterate_forward):
     52        * libpas/src/libpas/pas_segregated_heap.c:
     53        (pas_segregated_heap_ensure_size_directory_for_count):
     54        * libpas/src/libpas/pas_segregated_shared_page_directory.c:
     55        (pas_segregated_shared_page_directory_find_first_eligible):
     56        * libpas/src/libpas/pas_segregated_shared_view.c:
     57        (compute_summary):
     58        * libpas/src/libpas/pas_segregated_view.c:
     59        (for_each_live_object):
     60        (should_be_eligible):
     61        * libpas/src/libpas/pas_status_reporter.c:
     62        (pas_status_reporter_dump_large_map):
     63        * libpas/src/libpas/pas_stream.h:
     64        * libpas/src/libpas/pas_string_stream.c:
     65        (string_stream_vprintf):
     66        * libpas/src/libpas/pas_string_stream.h:
     67        * libpas/src/libpas/pas_thread_local_cache.c:
     68        (suspend):
     69        * libpas/src/libpas/pas_tiny_large_map_entry.h:
     70        (pas_tiny_large_map_entry_can_create):
     71        * libpas/src/libpas/pas_try_allocate_common.h:
     72        (pas_try_allocate_common_impl_fast):
     73        (pas_try_allocate_common_impl_slow):
     74        * libpas/src/libpas/pas_try_allocate_intrinsic.h:
     75        * libpas/src/libpas/pas_utils.h:
     76
    1772021-10-20  Michael Catanzaro  <mcatanzaro@gnome.org>
    278
  • trunk/Source/bmalloc/libpas/src/libpas/pas_all_heaps.c

    r282556 r284895  
    368368            dump_directory_nicely(directory);
    369369            dump_view_nicely(index, view);
    370             pas_log(": didn't expect it to be empty.\n",
    371                     index, view);
     370            pas_log(": didn't expect it to be empty.\n");
    372371            PAS_ASSERT(!is_empty);
    373372        }
  • trunk/Source/bmalloc/libpas/src/libpas/pas_bitfit_directory.c

    r283178 r284895  
    438438               owns it while holding the lock. Newly created pages start out empty.  */
    439439            if (max_free != PAS_BITFIT_MAX_FREE_EMPTY) {
    440                 pas_log("%p:%u: found non-empty page that is dead when taking last empty.\n");
     440                pas_log("%p:%zu: found non-empty page that is dead when taking last empty.\n", page, index);
    441441                PAS_ASSERT(max_free == PAS_BITFIT_MAX_FREE_EMPTY);
    442442            }
     
    445445               lock. */
    446446            if (max_free == PAS_BITFIT_MAX_FREE_EMPTY) {
    447                 pas_log("%p:%u: found empty page that is not dead when taking last empty.\n");
     447                pas_log("%p:%zu: found empty page that is not dead when taking last empty.\n", page, index);
    448448                PAS_ASSERT(max_free != PAS_BITFIT_MAX_FREE_EMPTY);
    449449            }
  • trunk/Source/bmalloc/libpas/src/libpas/pas_bitfit_heap.c

    r282556 r284895  
    8484
    8585        if (verbose)
    86             pas_log("max object size = %u\n", page_config.base.max_object_size);
     86            pas_log("max object size = %zu\n", page_config.base.max_object_size);
    8787
    8888        PAS_ASSERT(
  • trunk/Source/bmalloc/libpas/src/libpas/pas_bitfit_page_inlines.h

    r282556 r284895  
    370370                if (verbose) {
    371371                    pas_log("Need to do a search starting at word_index = %lu + 1, "
    372                             "num_remaining_needed_bits = %lu\n",
     372                            "num_remaining_needed_bits = %llu\n",
    373373                            word_index, num_remaining_needed_bits);
    374374                }
     
    384384
    385385                    if (verbose) {
    386                         pas_log("At other_word_index = %lu, num_remaining_needed_bits = %lu\n",
     386                        pas_log("At other_word_index = %lu, num_remaining_needed_bits = %llu\n",
    387387                                other_word_index, num_remaining_needed_bits);
    388388                    }
     
    797797                        free_words[intermediate_word_index] = UINT64_MAX;
    798798                    if (verbose) {
    799                         pas_log("object_end_bit_index = %lu, mask = %llu\n",
     799                        pas_log("object_end_bit_index = %llu, mask = %llu\n",
    800800                                object_end_bit_index, pas_make_mask64(object_end_bit_index + 1));
    801801                    }
     
    805805                if (verbose) {
    806806                    pas_log("word_index = %lu, bit_index_in_word = %lu, other_word_index = %lu, "
    807                             "object_end_bit_index = %lu\n",
     807                            "object_end_bit_index = %llu\n",
    808808                            word_index, bit_index_in_word, other_word_index, object_end_bit_index);
    809809                }
  • trunk/Source/bmalloc/libpas/src/libpas/pas_commit_span.c

    r279867 r284895  
    4040{
    4141    if (verbose)
    42         pas_log("%p: creating commit span.\n");
     42        pas_log("%p: creating commit span.\n", span);
    4343    span->index_of_start_of_span = UINTPTR_MAX;
    4444    span->did_add_first = false;
     
    6767   
    6868    if (verbose)
    69         pas_log("%p: adding a thing.\n");
     69        pas_log("%p: adding a thing.\n", span);
    7070
    7171    PAS_ASSERT(span->index_of_start_of_span < granule_index);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_enumerate_large_heaps.c

    r282556 r284895  
    5454    static const bool verbose = false;
    5555    if (verbose)
    56         pas_log("record_span: %p...%p\n", range.begin, range.end);
     56        pas_log("record_span: %p...%p\n", (void*)range.begin, (void*)range.end);
    5757    pas_enumerator_record(
    5858        enumerator, (void*)range.begin, pas_range_size(range), pas_enumerator_payload_record);
     
    141141
    142142            if (verbose)
    143                 pas_log("Looking at page %p\n", page);
     143                pas_log("Looking at page %p\n", (void*)page);
    144144           
    145145            if (!pas_enumerator_exclude_accounted_page(enumerator, (void*)page))
  • trunk/Source/bmalloc/libpas/src/libpas/pas_fd_stream.c

    r279867 r284895  
    3232#include "pas_log.h"
    3333
    34 static void fd_stream_vprintf(pas_stream* stream, const char* format, va_list arg_list)
     34static PAS_FORMAT_PRINTF(2, 0) void fd_stream_vprintf(pas_stream* stream, const char* format, va_list arg_list)
    3535{
    3636    pas_fd_stream_vprintf((pas_fd_stream*)stream, format, arg_list);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_fd_stream.h

    r279867 r284895  
    5050PAS_API void pas_fd_stream_construct(pas_fd_stream* stream, int fd);
    5151
    52 PAS_API void pas_fd_stream_vprintf(pas_fd_stream* stream, const char* format, va_list arg_list);
     52PAS_API void pas_fd_stream_vprintf(pas_fd_stream* stream, const char* format, va_list arg_list) PAS_FORMAT_PRINTF(2, 0);
    5353
    5454#define pas_fd_stream_printf(stream, ...) \
  • trunk/Source/bmalloc/libpas/src/libpas/pas_hashtable.h

    r279867 r284895  
    113113        new_byte_size = (size_t)new_size * sizeof(entry_type); \
    114114        if (verbose) \
    115             pas_log("Allocating a new table with new_size = %zu, new_byte_size = %zu.\n", new_size, new_byte_size); \
     115            pas_log("Allocating a new table with new_size = %u, new_byte_size = %zu.\n", new_size, new_byte_size); \
    116116        new_table = (entry_type*)allocation_config->allocate( \
    117117            new_byte_size, #name "/table", pas_object_allocation, allocation_config->arg); \
  • trunk/Source/bmalloc/libpas/src/libpas/pas_large_map.c

    r279867 r284895  
    9393
    9494        if (verbose)
    95             pas_log("adding base = %p.\n", tiny_base);
     95            pas_log("adding base = %p.\n", (void*)tiny_base);
    9696
    9797        add_result = pas_tiny_large_map_hashtable_add(
     
    160160    tiny_base = pas_tiny_large_map_entry_base(begin);
    161161    if (verbose)
    162         pas_log("tiny_base = %p.\n", tiny_base);
     162        pas_log("tiny_base = %p.\n", (void*)tiny_base);
    163163    first_level_tiny_entry = pas_tiny_large_map_hashtable_find(
    164164        &pas_tiny_large_map_hashtable_instance, tiny_base);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_large_sharing_pool.c

    r284208 r284895  
    121121       
    122122        if (verbose) {
    123             pas_log(" %zu:%p:%lu-%lu:%llu",
     123            pas_log(" %d:%p:%lu-%lu:%llu",
    124124                    node->index_in_min_heap,
    125125                    node, node->range.begin, node->range.end,
  • trunk/Source/bmalloc/libpas/src/libpas/pas_local_allocator_inlines.h

    r282899 r284895  
    162162
    163163    if (verbose) {
    164         pas_log("%p, %s: Setting up alloc bits in range %zu...%zu\n",
     164        pas_log("%p, %s: Setting up alloc bits in range %u...%u\n",
    165165                allocator,
    166166                pas_local_allocator_config_kind_get_string(allocator->config_kind),
     
    12891289
    12901290    if (verbose) {
    1291         pas_log("Full alloc bits have range %zu...%zu\n",
     1291        pas_log("Full alloc bits have range %u...%u\n",
    12921292                full_alloc_bits.word_index_begin,
    12931293                full_alloc_bits.word_index_end);
     
    14541454
    14551455        if (verbose)
    1456             pas_log("payload_end = %p\n", allocator->payload_end);
     1456            pas_log("payload_end = %p\n", (void*)allocator->payload_end);
    14571457       
    14581458        PAS_TESTING_ASSERT(allocator->payload_end);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_log.c

    r282556 r284895  
    3333#include "pas_snprintf.h"
    3434#include <unistd.h>
    35 
    36 #pragma clang diagnostic push
    37 #pragma clang diagnostic ignored "-Wformat-nonliteral"
    3835
    3936pthread_t pas_thread_that_is_crash_logging;
  • trunk/Source/bmalloc/libpas/src/libpas/pas_log.h

    r279867 r284895  
    4242   PAS_LOG_MAX_BYTES at a time. */
    4343
    44 PAS_API void pas_vlog_fd(int fd, const char* format, va_list);
    45 PAS_API void pas_log_fd(int fd, const char* format, ...);
     44PAS_API void pas_vlog_fd(int fd, const char* format, va_list) PAS_FORMAT_PRINTF(2, 0);
     45PAS_API void pas_log_fd(int fd, const char* format, ...) PAS_FORMAT_PRINTF(2, 3);
    4646
    47 PAS_API void pas_vlog(const char* format, va_list);
    48 PAS_API void pas_log(const char* format, ...);
     47PAS_API void pas_vlog(const char* format, va_list) PAS_FORMAT_PRINTF(1, 0);
     48PAS_API void pas_log(const char* format, ...) PAS_FORMAT_PRINTF(1, 2);
    4949
    5050PAS_API void pas_start_crash_logging(void);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_page_sharing_pool.c

    r282556 r284895  
    234234        pas_log("Adding participant %p to pool %p (%s), index = %zu.\n",
    235235                participant,
     236                pool,
    236237                pas_page_sharing_participant_kind_get_string(
    237238                    pas_page_sharing_participant_get_kind(participant)),
    238                 pool,
    239239                index_in_sharing_pool);
    240240    }
  • trunk/Source/bmalloc/libpas/src/libpas/pas_segregated_directory_inlines.h

    r282556 r284895  
    117117        if (config->first_considered == SIZE_MAX) {
    118118            if (verbose)
    119                 pas_log("%p: setting first_considered to 0\n", config->directory, config->index);
     119                pas_log("%p: setting first_considered to %zu\n", config->directory, config->index);
    120120            config->first_considered = config->index;
    121121        } else {
     
    182182    if (verbose) {
    183183        pas_log("Actually using segmented bitvector iteration.\n");
    184         pas_log("Segmented bitvector size = %zu\n", data->bitvectors.size);
     184        pas_log("Segmented bitvector size = %u\n", data->bitvectors.size);
    185185    }
    186186    found_index = pas_segregated_directory_segmented_bitvectors_iterate(
  • trunk/Source/bmalloc/libpas/src/libpas/pas_segregated_heap.c

    r282556 r284895  
    12561256                if (candidate) {
    12571257                    if (verbose)
    1258                         pas_log("Have candidate with size = %zu\n", candidate->object_size);
     1258                        pas_log("Have candidate with size = %d\n", candidate->object_size);
    12591259                   
    12601260                    /* If the candidate at this index has an object size that is no larger than the
  • trunk/Source/bmalloc/libpas/src/libpas/pas_segregated_shared_page_directory.c

    r282556 r284895  
    129129
    130130    if (verbose)
    131         pas_log("trying to allocate size = %zu, alignment = %zu.\n", size, alignment);
     131        pas_log("trying to allocate size = %u, alignment = %u.\n", size, alignment);
    132132
    133133    data.size = size;
  • trunk/Source/bmalloc/libpas/src/libpas/pas_segregated_shared_view.c

    r282556 r284895  
    269269
    270270    if (verbose)
    271         pas_log("index = %zu, bump_offset = %lu/%lu.\n", view->index, end_of_payload, end_of_page);
     271        pas_log("index = %d, bump_offset = %lu/%lu.\n", view->index, end_of_payload, end_of_page);
    272272   
    273273    PAS_ASSERT(start_of_payload >= start_of_page);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_segregated_view.c

    r282556 r284895  
    371371
    372372    if (verbose) {
    373         pas_log("page = %p, got alloc bits range %zu...%zu.\n",
     373        pas_log("page = %p, got alloc bits range %u...%u.\n",
    374374                page,
    375375                full_alloc_bits.word_index_begin,
     
    462462        if (verbose) {
    463463            pas_log("Checking if can bump for shared view %p, bump %u, max object size %zu, "
    464                     "bump limit %u\n",
     464                    "bump limit %zu\n",
    465465                    shared_view, shared_view->bump_offset, page_config->base.max_object_size,
    466466                    pas_segregated_page_config_object_payload_end_offset_from_boundary(*page_config));
     
    484484
    485485    if (verbose) {
    486         pas_log("page = %p, got alloc bits range %zu...%zu.\n",
     486        pas_log("page = %p, got alloc bits range %u...%u.\n",
    487487                page,
    488488                full_alloc_bits.word_index_begin,
  • trunk/Source/bmalloc/libpas/src/libpas/pas_status_reporter.c

    r283178 r284895  
    419419    pas_stream_printf(
    420420        stream,
    421         "        Tiny Map: Num Entries: %zu, Num Deleted: %zu, Table Size: %zu\n",
     421        "        Tiny Map: Num Entries: %u, Num Deleted: %u, Table Size: %u\n",
    422422        pas_tiny_large_map_hashtable_instance.key_count,
    423423        pas_tiny_large_map_hashtable_instance.deleted_count,
     
    425425    pas_stream_printf(
    426426        stream,
    427         "        Small Fallback Map: Num Entries: %zu, Num Deleted: %zu, Table Size: %zu\n",
     427        "        Small Fallback Map: Num Entries: %u, Num Deleted: %u, Table Size: %u\n",
    428428        pas_small_large_map_hashtable_instance.key_count,
    429429        pas_small_large_map_hashtable_instance.deleted_count,
     
    431431    pas_stream_printf(
    432432        stream,
    433         "        Fallback Map: Num Entries: %zu, Num Deleted: %zu, Table Size: %zu\n",
     433        "        Fallback Map: Num Entries: %u, Num Deleted: %u, Table Size: %u\n",
    434434        pas_large_map_hashtable_instance.key_count,
    435435        pas_large_map_hashtable_instance.deleted_count,
  • trunk/Source/bmalloc/libpas/src/libpas/pas_stream.h

    r279867 r284895  
    4444
    4545struct pas_stream_functions {
    46     void (*vprintf)(pas_stream* stream, const char* format, va_list arg_list);
     46    void (*vprintf)(pas_stream* stream, const char* format, va_list) PAS_FORMAT_PRINTF(2, 0);
    4747};
    4848
    4949#define PAS_STREAM_INITIALIZER(passed_functions) { .functions = (passed_functions) }
    5050
    51 PAS_API void pas_stream_vprintf(pas_stream* stream, const char* format, va_list);
    52 PAS_API void pas_stream_printf(pas_stream* stream, const char* format, ...);
     51PAS_API void pas_stream_vprintf(pas_stream* stream, const char* format, va_list) PAS_FORMAT_PRINTF(2, 0);
     52PAS_API void pas_stream_printf(pas_stream* stream, const char* format, ...) PAS_FORMAT_PRINTF(2, 3);
    5353
    5454static inline void pas_stream_print_comma(pas_stream* stream, bool* comma, const char* string)
  • trunk/Source/bmalloc/libpas/src/libpas/pas_string_stream.c

    r282556 r284895  
    3333#include "pas_snprintf.h"
    3434
    35 #pragma clang diagnostic push
    36 #pragma clang diagnostic ignored "-Wformat-nonliteral"
    37 
    38 static void string_stream_vprintf(pas_stream* stream, const char* format, va_list arg_list)
     35static PAS_FORMAT_PRINTF(2, 0) void string_stream_vprintf(pas_stream* stream, const char* format, va_list arg_list)
    3936{
    4037    pas_string_stream_vprintf((pas_string_stream*)stream, format, arg_list);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_string_stream.h

    r279867 r284895  
    5252PAS_API void pas_string_stream_reset(pas_string_stream* stream);
    5353
    54 PAS_API void pas_string_stream_vprintf(pas_string_stream* stream, const char* format, va_list);
     54PAS_API void pas_string_stream_vprintf(pas_string_stream* stream, const char* format, va_list) PAS_FORMAT_PRINTF(2, 0);
    5555
    5656#define pas_string_stream_printf(stream, ...) \
  • trunk/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c

    r282899 r284895  
    556556
    557557    if (result != KERN_SUCCESS) {
    558         pas_log("[%d] Failed to suspend pthread %p (mach thread %p) associated with TLC %p: %d\n",
     558        pas_log("[%d] Failed to suspend pthread %p (mach thread %d) associated with TLC %p: %d\n",
    559559                getpid(), thread, mach_thread, cache, result);
    560560        dump_thread_diagnostics(thread);
  • trunk/Source/bmalloc/libpas/src/libpas/pas_tiny_large_map_entry.h

    r279867 r284895  
    114114    base = pas_tiny_large_map_entry_base(entry.begin);
    115115    if (verbose)
    116         pas_log("base = %p.\n", base);
     116        pas_log("base = %p.\n", (void*)base);
    117117    result = pas_tiny_large_map_entry_create(entry);
    118118    if (verbose) {
     
    124124                (unsigned)result.bytes[4]);
    125125        pas_log("round tripped: %p...%p, heap = %p.\n",
    126                 pas_tiny_large_map_entry_begin(result, base),
    127                 pas_tiny_large_map_entry_end(result, base),
    128                 pas_tiny_large_map_entry_heap(result));
     126                (void*)pas_tiny_large_map_entry_begin(result, base),
     127                (void*)pas_tiny_large_map_entry_end(result, base),
     128                (void*)pas_tiny_large_map_entry_heap(result));
    129129    }
    130130    return entry.begin == pas_tiny_large_map_entry_begin(result, base)
  • trunk/Source/bmalloc/libpas/src/libpas/pas_try_allocate_common.h

    r282899 r284895  
    7575                                              result_filter);
    7676    if (verbose)
    77         pas_log("in common - result.begin = %p\n", result.begin);
     77        pas_log("in common - result.begin = %p\n", (void*)result.begin);
    7878    return result;
    7979}
     
    113113        result = pas_debug_heap_allocate(size, alignment);
    114114        if (verbose)
    115             pas_log("Got result.ptr = %p, did_succeed = %d\n", result.begin, result.did_succeed);
     115            pas_log("Got result.ptr = %p, did_succeed = %d\n", (void*)result.begin, result.did_succeed);
    116116        return result;
    117117    }
  • trunk/Source/bmalloc/libpas/src/libpas/pas_try_allocate_intrinsic.h

    r283371 r284895  
    322322        pas_allocation_result result = name(size, 1); \
    323323        if (verbose) \
    324             pas_log("result.begin = %p\n", result.begin); \
     324            pas_log("result.begin = %p\n", (void*)result.begin); \
    325325        return result; \
    326326    } \
  • trunk/Source/bmalloc/libpas/src/libpas/pas_utils.h

    r282556 r284895  
    6969#define PAS_ALIGNED(amount) __attribute__((aligned(amount)))
    7070
     71#define PAS_FORMAT_PRINTF(fmt, args) __attribute__((format(__printf__, fmt, args)))
     72
    7173#define PAS_UNUSED __attribute__((unused))
    7274
     
    8385
    8486/* NOTE: panic format string must have \n at the end. */
    85 PAS_API PAS_NO_RETURN void pas_panic(const char* format, ...);
     87PAS_API PAS_NO_RETURN void pas_panic(const char* format, ...) PAS_FORMAT_PRINTF(1, 2);
    8688
    8789#define pas_set_deallocation_did_fail_callback __pas_set_deallocation_did_fail_callback
Note: See TracChangeset for help on using the changeset viewer.