History log of /libuv/src/unix/darwin.c (Results 1 – 25 of 76)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# c0a61c3b 14-Apr-2024 Saúl Ibarra Corretgé

darwin: simplify uv_hrtime

mach_continuous_time is available since macOS 10.12, but our minimum
version is 11, so no need for a workaround.

Also, prefer that to `clock_gettime_n

darwin: simplify uv_hrtime

mach_continuous_time is available since macOS 10.12, but our minimum
version is 11, so no need for a workaround.

Also, prefer that to `clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW)` which
the documentation suggests
(https://developer.apple.com/documentation/driverkit/3438077-mach_continuous_time)
since the latter calls mach_timebase_info every time, unnecessarify: https://github.com/apple-open-source/macos/blob/49dcc07a40d19fa97384033a8398dae5d00d11a1/Libc/gen/clock_gettime.c#L107

show more ...


# 1230fad8 12-Jul-2023 小明 <7737673+caobug@users.noreply.github.com>

darwin: fix build warnings (#4073)


# 988d225c 24-Nov-2022 Tim Besard

unix,win: add uv_get_available_memory() (#3754)


# 6f696542 11-Nov-2022 theanarkh

misc: fix return value of memory functions (#3818)

Specifically uv_get_free_memory and uv_get_total_memory.


# 33005022 08-Nov-2022 Jameson Nash

darwin: use hw.cpufrequency again for frequency info (#3679)

This reverts commit 87f076515937345fda1a1dbc598f34e65e1b81c7 and
implements a work-around instead. This has been reported to

darwin: use hw.cpufrequency again for frequency info (#3679)

This reverts commit 87f076515937345fda1a1dbc598f34e65e1b81c7 and
implements a work-around instead. This has been reported to be
unnecessary, and also returns the wrong answer (off by exactly 100x),
so it is not particularly useful.

This also reverts the bugfixes to the original PR:

Revert "darwin: fix iOS compilation and functionality"
This reverts commit 1addf9b88a17bc32d009d377a14d540ccddd06db.

Revert "macos: fix the cfdata length in uv__get_cpu_speed (#3356)"
This reverts commit 1e7074913e1d2a1be72b62ba807325c14b0b317a.

Revert "darwin: fix -Wsometimes-uninitialized warning"
This reverts commit 6085bcef8dea1eaa21a92e2b6e6f03a0476b6c54.

Revert "macos: fix memleaks in uv__get_cpu_speed"
This reverts commit d2482ae121e0ae5d0cf0934b2e93cee81a4ac5ed.

The expected behavior on failure to read this info is to report 0 (for
example
https://github.com/libuv/libuv/blob/8975c05d199558b0cc2e98f26ce33c6090d1
d7a1/src/unix/linux.c#L834), which is which was not the case before
this PR for macos.

However hw.cpufrequency sysctl seems to be missing on darwin/arm64
(Apple Silicon), so we instead hardcode a plausible value. This value
matches what the mach kernel will report when running Rosetta apps.

Fixes: https://github.com/libuv/libuv/issues/3642
Fixes: https://github.com/libuv/libuv/issues/2911
Refs: https://github.com/libuv/libuv/pull/2912

show more ...


# 1e707491 25-Nov-2021 Jesper Storm Bache

macos: fix the cfdata length in uv__get_cpu_speed (#3356)

We observed crashes inside CFRelease in uv__get_cpu_speed on the new
Mac Book Pro (arm) hardware. The problem is that the stack

macos: fix the cfdata length in uv__get_cpu_speed (#3356)

We observed crashes inside CFRelease in uv__get_cpu_speed on the new
Mac Book Pro (arm) hardware. The problem is that the stack got
clobbered. On the new mac hardware the returned length is 8.

For the 4 byte case, a temp variable is used to avoid having to add
endian-sensitive offsets.

Fixes: https://github.com/libuv/libuv/issues/3355

show more ...


# 6085bcef 28-May-2021 twosee

darwin: fix -Wsometimes-uninitialized warning

PR-URL: https://github.com/libuv/libuv/pull/3190
Reviewed-By: Jameson Nash <vtjnash@gmail.com>


Revision tags: v1.41.0
# 1addf9b8 29-Jan-2021 Hayden

darwin: fix iOS compilation and functionality

PR-URL: https://github.com/libuv/libuv/pull/3106
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.

darwin: fix iOS compilation and functionality

PR-URL: https://github.com/libuv/libuv/pull/3106
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>

show more ...


# d2482ae1 18-Jan-2021 George Zhao

macos: fix memleaks in uv__get_cpu_speed

ERROR: LeakSanitizer: detected memory leaks

```
Direct leak of 432 byte(s) in 9 object(s) allocated from:
#0 0x1062eedc2 in __sa

macos: fix memleaks in uv__get_cpu_speed

ERROR: LeakSanitizer: detected memory leaks

```
Direct leak of 432 byte(s) in 9 object(s) allocated from:
#0 0x1062eedc2 in __sanitizer_mz_calloc+0x92 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x46dc2)
#1 0x7fff20171eb6 in _malloc_zone_calloc+0x3a (libsystem_malloc.dylib:x86_64+0x1beb6)
#2 0x7fff203ac180 in _CFRuntimeCreateInstance+0x124 (CoreFoundation:x86_64h+0x4180)
#3 0x7fff203ab906 in __CFStringCreateImmutableFunnel3+0x84d (CoreFoundation:x86_64h+0x3906)
#4 0x7fff203ab0a1 in CFStringCreateWithCString+0x48 (CoreFoundation:x86_64h+0x30a1)
#5 0x1056f63e1 in uv__get_cpu_speed darwin.c:267
#6 0x1056f491e in uv_cpu_info darwin.c:338
```

PR-URL: https://github.com/libuv/libuv/pull/3098
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>

show more ...


Revision tags: v1.40.0, v1.39.0
# 87f07651 04-Aug-2020 Evan Lucas

darwin: use IOKit for uv_cpu_info

This switches uv_cpu_info from using sysctlbyname to
using IOKit to get the speed of the processors.
macOS on ARM does not currently have the hw.cpu

darwin: use IOKit for uv_cpu_info

This switches uv_cpu_info from using sysctlbyname to
using IOKit to get the speed of the processors.
macOS on ARM does not currently have the hw.cpufrequency
sysctl. We are able to reliable get the clock frequency
on all architectures by using IOKit.

Fixes: https://github.com/libuv/libuv/issues/2911
PR-URL: https://github.com/libuv/libuv/pull/2914
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...


Revision tags: v1.38.1
# 4685be23 01-Jul-2020 Ben Noordhuis

darwin: work around clock jumping back in time

It was reported that mach_absolute_time() can jump backward in time when
the machine is suspended. Use mach_continuous_time() when availabl

darwin: work around clock jumping back in time

It was reported that mach_absolute_time() can jump backward in time when
the machine is suspended. Use mach_continuous_time() when available to
work around that (macOS 10.12 and up.)

Fixes: https://github.com/libuv/libuv/issues/2891
PR-URL: https://github.com/libuv/libuv/pull/2894
Reviewed-By: Phil Willoughby <philwill@fb.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>

show more ...


Revision tags: v1.38.0, v1.37.0, v1.36.0, v1.35.0, v1.34.2, v1.34.1
# 2ab3dc15 16-Dec-2019 David Carlier

unix: pass sysctl size arg using ARRAY_SIZE macro

PR-URL: https://github.com/libuv/libuv/pull/2510
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santi

unix: pass sysctl size arg using ARRAY_SIZE macro

PR-URL: https://github.com/libuv/libuv/pull/2510
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.34.0, v1.33.1, v1.33.0, v1.32.0
# 040543ee 17-Aug-2019 Santiago Gimeno

src: move uv_free_cpu_info to uv-common.c

PR-URL: https://github.com/libuv/libuv/pull/2433
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.co

src: move uv_free_cpu_info to uv-common.c

PR-URL: https://github.com/libuv/libuv/pull/2433
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.31.0, v1.30.1, v1.30.0, v1.29.1, v1.29.0
# c4e9657d 01-May-2019 Kelvin Jin

unix,win: add uv_get_constrained_memory()

Fixes: https://github.com/libuv/libuv/issues/2286
PR-URL: https://github.com/libuv/libuv/pull/2289
Reviewed-By: Ben Noordhuis <info@bnoordhu

unix,win: add uv_get_constrained_memory()

Fixes: https://github.com/libuv/libuv/issues/2286
PR-URL: https://github.com/libuv/libuv/pull/2289
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

Revision tags: v1.28.0, v1.27.0, v1.26.0, v1.25.0, v1.24.1, v1.24.0, v1.23.2, v1.23.1, v1.23.0, v1.22.0, v1.21.0, v1.20.3, v1.20.2, v1.20.1, v1.20.0, v1.19.2, v1.19.1
# 89cbbc89 19-Jan-2018 Mason X

include,src: introduce UV__ERR() macro

Using -errno, -E**, and -pthread_function() can be
error prone, and breaks compatibility with some operating
systems that already negate errno'

include,src: introduce UV__ERR() macro

Using -errno, -E**, and -pthread_function() can be
error prone, and breaks compatibility with some operating
systems that already negate errno's (e.g. Haiku).

This commit adds a UV__ERR() macro that ensures libuv
errors are negative.

Fixes: https://github.com/libuv/help/issues/39
PR-URL: https://github.com/libuv/libuv/pull/1687
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.19.0, v1.18.0, v1.17.0, v1.16.1, v1.16.0, v1.15.0, v1.14.1, v1.14.0, v1.13.1, v1.13.0, v1.12.0
# f277cb6f 21-Feb-2017 Brad King

unix: factor out reusable BSD ifaddrs impl

Create a dedicated source file to share among platforms on which we find
ifaddrs using the BSD getifaddrs API. De-duplicate our existing copie

unix: factor out reusable BSD ifaddrs impl

Create a dedicated source file to share among platforms on which we find
ifaddrs using the BSD getifaddrs API. De-duplicate our existing copies
of this implementation on such platforms.

PR-URL: https://github.com/libuv/libuv/pull/1240
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

# 0f84c305 18-Feb-2017 Brad King

unix: factor out getifaddrs result filter

On platforms using getifaddrs we iterate over the interfaces two or
three times. First we count them, then we enumerate them, and then we
f

unix: factor out getifaddrs result filter

On platforms using getifaddrs we iterate over the interfaces two or
three times. First we count them, then we enumerate them, and then we
fill in physical addresses. Each loop needs to do the same filtering,
so factor out the exclusion test into a helper function for each
platform.

PR-URL: https://github.com/libuv/libuv/pull/1240
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.11.0
# f35674fe 27-Jan-2017 Chris Araman

Revert "darwin: use clock_gettime in macOS 10.12"

This reverts commit f8d4805087944cb8543d98109f5f83f4938eb4b5,
which causes run-time link errors when compiled with macOS 10.12
SDK,

Revert "darwin: use clock_gettime in macOS 10.12"

This reverts commit f8d4805087944cb8543d98109f5f83f4938eb4b5,
which causes run-time link errors when compiled with macOS 10.12
SDK, but run on 10.11 or earlier.

Refs: https://github.com/libuv/libuv/pull/1073
PR-URL: https://github.com/libuv/libuv/pull/1202
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

show more ...

Revision tags: v1.10.2, v1.10.1, v1.10.0
# f8d48050 28-Sep-2016 Saúl Ibarra Corretgé

darwin: use clock_gettime in macOS 10.12

PR-URL: https://github.com/libuv/libuv/pull/1073
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Imran Iqbal <imran@imraniqbal.or

darwin: use clock_gettime in macOS 10.12

PR-URL: https://github.com/libuv/libuv/pull/1073
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>

show more ...

Revision tags: v0.10.37, v1.9.1, v1.9.0, v1.8.0, v1.7.5
# 25c369d4 22-Sep-2015 Jianghua Yang

unix: fix memory leak in uv_interface_addresses

PR-URL: https://github.com/libuv/libuv/pull/537
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

# 9c307cc6 22-Sep-2015 Jianghua Yang

darwin: fix memory leak in uv_cpu_info

PR-URL: https://github.com/libuv/libuv/pull/538
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail

darwin: fix memory leak in uv_cpu_info

PR-URL: https://github.com/libuv/libuv/pull/538
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v1.7.4, v1.7.3, v1.7.2, v1.7.1, v1.7.0, v1.6.1, v1.6.0
# bddd6a84 26-May-2015 Saúl Ibarra Corretgé

core: add ability to customize memory allocator

This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus so

core: add ability to customize memory allocator

This patch is composed by the work done in
https://github.com/libuv/libuv/pull/231 and
https://github.com/libuv/libuv/pull/287 plus some changes by yours
truly.

Thanks @beevik and @mattsta for their work on this!

PR-URL: https://github.com/libuv/libuv/pull/368
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...

Revision tags: v1.5.0
# 1f711e4d 29-Apr-2015 Saúl Ibarra Corretgé

Revert "memory: add uv_replace_allocator"

This reverts commit c272f1f1bc0bda625e6441d798c110b4064a6ce2.

The concept will come back to libuv, but it needs some more work.

# c272f1f1 26-Feb-2015 Brett Vickers

memory: add uv_replace_allocator

With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This

memory: add uv_replace_allocator

With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This allows libuv to interoperate with projects requiring a
custom memory allocator.

Internally, all calls to malloc and free have been replaced with
uv__malloc and uv__free, respectively. The uv__malloc and uv__free
functions call malloc and free unless they have been overridden by a
previous call to uv_replace_allocator.

As part of this change, the special aligned memory allocations
performed in src/win/fs-event.c have been replaced with standard
allocations. The 4-byte alignment being requested in this file was
unnecessary, since standard allocators already guarantee at least an
8-byte alignment.

PR-URL: https://github.com/libuv/libuv/pull/231
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

Revision tags: v0.10.36, v1.4.2, v0.10.35, v1.4.1, v0.10.34, v1.4.0, v1.3.0, v0.10.33
# 32747c75 20-Jan-2015 Andrius Bentkus

win,unix: move loop functions which have identical implementations

uv_default_loop, uv_loop_new, uv_loop_close, uv_loop_delete

PR-URL: https://github.com/libuv/libuv/pull/144
Re

win,unix: move loop functions which have identical implementations

uv_default_loop, uv_loop_new, uv_loop_close, uv_loop_delete

PR-URL: https://github.com/libuv/libuv/pull/144
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Saúl Ibarra Corretgé <saghul@gmail.com>

show more ...

1234