History log of /curl/lib/curl_memory.h (Results 1 – 25 of 26)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 28d1d71f 20-Sep-2024 Viktor Szakats

lib: memdebug comment fixup [ci skip]

Follow-up to 3efba94f773db5d8ae19e33aa749ab7914cafeea #14765


# 3efba94f 02-Sep-2024 Viktor Szakats

cmake: allow building tests in unity mode

Makes building tests noticeably faster.

Apply changes/fixes/workarounds to make Unity work:
- rename test variables to avoid collisions

cmake: allow building tests in unity mode

Makes building tests noticeably faster.

Apply changes/fixes/workarounds to make Unity work:
- rename test variables to avoid collisions or shadowing each other when
combined into single units.
- add workaround to avoid applying `lib/memdebug.h` overrides to system
headers declaring/defining `getaddrinfo()`/`freeaddrinfo()` for
`tests/server/resolve.c`. This replaces a previous workaround that
worked for that specific source.
- rename test macro `CTRL` clashing with Cygwin `sys/ioctl.h`.
- add include guard to `test.h`.

Also:
- exclude `tests/http/clients` which are all single-source. (like
`docs/examples`.)

Build time improvements for tests:
- AppVeyor CI:
- MSVC 2008, 2010: 1 minute faster (4m8s -> 2m56s, 3m19s -> 2m24s)
- MSVC 2022 arm64: 3.5 minutes faster (10m18s -> 6m48s)
before: https://ci.appveyor.com/project/curlorg/curl/builds/50522785
after: https://ci.appveyor.com/project/curlorg/curl/builds/50522942
- GHA:
- Cygwin: 1.5 minutes faster (3m13s -> 1m43s)
before: https://github.com/curl/curl/actions/runs/10681535327/job/29605384398
after: https://github.com/curl/curl/actions/runs/10680818726/job/29603130637
- Windows:
before: https://github.com/curl/curl/actions/runs/10680818713
after: https://github.com/curl/curl/actions/runs/10683850187
- MSYS2, mingw-w64: 1 minute faster
- MSVC: 30 seconds faster (3m17s -> 2m48s)
- macOS: double speed (39s -> 18s)
before: https://github.com/curl/curl/actions/runs/10680818753/job/29603133447
after: https://github.com/curl/curl/actions/runs/10683850174/job/29612914515
- Linux: almost double speed (30/31s -> 18s)
before: https://github.com/curl/curl/actions/runs/10681535311/job/29605387156
after: https://github.com/curl/curl/actions/runs/10680818721/job/29603133976
- non-native: no obvious effect.
before: https://github.com/curl/curl/actions/runs/10680818722
after: https://github.com/curl/curl/actions/runs/10683850187
- Old Linux: Unity mode not supported by old CMake, no effect.

Closes #14765

show more ...


# e9a7d4a1 21-Nov-2023 Viktor Szakats

windows: use built-in `_WIN32` macro to detect Windows

Windows compilers define `_WIN32` automatically. Windows SDK headers
or build env defines `WIN32`, or we have to take care of it. T

windows: use built-in `_WIN32` macro to detect Windows

Windows compilers define `_WIN32` automatically. Windows SDK headers
or build env defines `WIN32`, or we have to take care of it. The
agreement seems to be that `_WIN32` is the preferred practice here.
Make the source code rely on that to detect we're building for Windows.

Public `curl.h` was using `WIN32`, `__WIN32__` and `CURL_WIN32` for
Windows detection, next to the official `_WIN32`. After this patch it
only uses `_WIN32` for this. Also, make it stop defining `CURL_WIN32`.

There is a slight chance these break compatibility with Windows
compilers that fail to define `_WIN32`. I'm not aware of any obsolete
or modern compiler affected, but in case there is one, one possible
solution is to define this macro manually.

grepping for `WIN32` remains useful to discover Windows-specific code.

Also:

- extend `checksrc` to ensure we're not using `WIN32` anymore.

- apply minor formatting here and there.

- delete unnecessary checks for `!MSDOS` when `_WIN32` is present.

Co-authored-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Closes #12376

show more ...


# 3f8fc257 09-May-2023 Viktor Szakats

cmake: add support for "unity" builds

Aka "jumbo" or "amalgamation" builds. It means to compile all sources
per target as a single C source. This is experimental.

You can enable

cmake: add support for "unity" builds

Aka "jumbo" or "amalgamation" builds. It means to compile all sources
per target as a single C source. This is experimental.

You can enable it by passing `-DCMAKE_UNITY_BUILD=ON` to cmake.
It requires CMake 3.16 or newer.

It makes builds (much) faster, allows for better optimizations and tends
to promote less ambiguous code.

Also add a new AppVeyor CI job and convert an existing one to use
"unity" mode (one MSVC, one MinGW), and enable it for one macOS CI job.

Fix related issues:
- add missing include guard to `easy_lock.h`.
- rename static variables and functions (and a macro) with names reused
across sources, or shadowed by local variables.
- add an `#undef` after use.
- add a missing `#undef` before use.
- move internal definitions from `ftp.h` to `ftp.c`.
- `curl_memory.h` fixes to make it work when included repeatedly.
- stop building/linking curlx bits twice for a static-mode curl tool.
These caused doubly defined symbols in unity builds.
- silence missing extern declarations compiler warning for ` _CRT_glob`.
- fix extern declarations for `tool_freq` and `tool_isVistaOrGreater`.
- fix colliding static symbols in debug mode: `debugtime()` and
`statename`.
- rename `ssl_backend_data` structure to unique names for each
TLS-backend, along with the `ssl_connect_data` struct member
referencing them. This required adding casts for each access.
- add workaround for missing `[P]UNICODE_STRING` types in certain Windows
builds when compiling `lib/ldap.c`. To support "unity" builds, we had
to enable `SCHANNEL_USE_BLACKLISTS` for Schannel (a Windows
`schannel.h` option) _globally_. This caused an indirect inclusion of
Windows `schannel.h` from `ldap.c` via `winldap.h` to have it enabled
as well. This requires `[P]UNICODE_STRING` types, which is apperantly
not defined automatically (as seen with both MSVS and mingw-w64).
This patch includes `<subauth.h>` to fix it.
Ref: https://github.com/curl/curl/runs/13987772013
Ref: https://dev.azure.com/daniel0244/curl/_build/results?buildId=15827&view=logs&jobId=2c9f582d-e278-56b6-4354-f38a4d851906&j=2c9f582d-e278-56b6-4354-f38a4d851906&t=90509b00-34fa-5a81-35d7-5ed9569d331c
- tweak unity builds to compile `lib/memdebug.c` separately in memory
trace builds to avoid PP confusion.
- force-disable unity for test programs.
- do not compile and link libcurl sources to libtests _twice_ when libcurl
is built in static mode.

KNOWN ISSUES:
- running tests with unity builds may fail in cases.
- some build configurations/env may not compile in unity mode. E.g.:
https://ci.appveyor.com/project/curlorg/curl/builds/47230972/job/51wfesgnfuauwl8q#L250

Ref: https://github.com/libssh2/libssh2/issues/1034
Ref: https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html
Ref: https://en.wikipedia.org/wiki/Unity_build

Closes #11095

show more ...


# 5f307986 07-Apr-2023 Daniel Stenberg

lib: remove CURLX_NO_MEMORY_CALLBACKS

The only user of this define was 'chkdecimalpoint' - a special purpose
test tool that was built but not used anymore (since 17c18fbc3 - Apr
2020

lib: remove CURLX_NO_MEMORY_CALLBACKS

The only user of this define was 'chkdecimalpoint' - a special purpose
test tool that was built but not used anymore (since 17c18fbc3 - Apr
2020).

Closes #10908

show more ...


# 2bc1d775 02-Jan-2023 Daniel Stenberg

copyright: update all copyright lines and remove year ranges

- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- save

copyright: update all copyright lines and remove year ranges

- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205

show more ...


# ad9bc597 17-May-2022 max.mehl

copyright: make repository REUSE compliant

Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the

copyright: make repository REUSE compliant

Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869

show more ...


Revision tags: curl-7_76_1, curl-7_76_0, curl-7_75_0, curl-7_74_0
# ac0a88fd 05-Nov-2020 Daniel Stenberg

copyright: fix year ranges

Follow-up from 4d2f8006777


# 4d2f8006 04-Nov-2020 Daniel Stenberg

curl.se: new home

Closes #6172


Revision tags: curl-7_73_0, tiny-curl-7_72_0, curl-7_72_0, curl-7_71_1, curl-7_71_0, curl-7_70_0, curl-7_69_1, curl-7_69_0, curl-7_68_0, curl-7_67_0, curl-7_66_0, curl-7_65_3, curl-7_65_2, curl-7_65_1, curl-7_65_0
# 8ece8177 14-May-2019 Daniel Stenberg

cleanup: remove FIXME and TODO comments

They serve very little purpose and mostly just add noise. Most of them
have been around for a very long time. I read them all before removing

cleanup: remove FIXME and TODO comments

They serve very little purpose and mostly just add noise. Most of them
have been around for a very long time. I read them all before removing
or rephrasing them.

Ref: #3876
Closes #3883

show more ...


Revision tags: curl-7_64_1, curl-7_64_0, curl-7_63_0, curl-7_62_0, curl-7_61_1, curl-7_61_0, curl-7_60_0, curl-7_59_0, curl-7_58_0, curl-7_57_0, curl-7_56_1, curl-7_56_0, curl-7_55_1, curl-7_55_0, curl-7_54_1, curl-7_54_0
# f7df67cf 26-Mar-2017 klemens

spelling fixes

Closes #1356


Revision tags: curl-7_53_1, curl-7_53_0, curl-7_52_1, curl-7_52_0, curl-7_51_0, curl-7_50_3, curl-7_50_2, curl-7_50_1, curl-7_50_0, curl-7_49_1, curl-7_49_0
# a9a1d303 18-Apr-2016 Daniel Stenberg

includes: avoid duplicate memory callback typdefs even harder


# a29a6c2a 01-Apr-2016 Steve Holme

curl_memory.h: Fixed typo in comment

From commit 7218b52c49.


# 7db9782d 01-Apr-2016 Daniel Stenberg

curl.h: define CURL_DID_MEMORY_FUNC_TYPEDEFS

So that we only do the extra typedefs in curl_memory.h when we really
need to and avoid double typedefs.

follow-up commit to 7218b52

curl.h: define CURL_DID_MEMORY_FUNC_TYPEDEFS

So that we only do the extra typedefs in curl_memory.h when we really
need to and avoid double typedefs.

follow-up commit to 7218b52c49aeb1

Thanks-to: Steve Holme

show more ...


# 7218b52c 31-Mar-2016 Daniel Stenberg

curl_memory.h: avoid the curl/curl.h include

Discussed in #743


Revision tags: curl-7_48_0, curl-7_47_1
# 4af40b36 02-Feb-2016 Daniel Stenberg

URLs: change all http:// URLs to https://


Revision tags: curl-7_47_0, curl-7_46_0
# c341311a 24-Nov-2015 Daniel Stenberg

Revert "cleanup: general removal of TODO (and similar) comments"

This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a.

Feedback-by: Dan Fandrich
URL: http://curl.haxx.se

Revert "cleanup: general removal of TODO (and similar) comments"

This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a.

Feedback-by: Dan Fandrich
URL: http://curl.haxx.se/mail/lib-2015-11/0062.html

show more ...


# 64e959ff 13-Nov-2015 Daniel Stenberg

cleanup: general removal of TODO (and similar) comments

They tend to never get updated anyway so they're frequently inaccurate
and we never go back to revisit them anyway. We document is

cleanup: general removal of TODO (and similar) comments

They tend to never get updated anyway so they're frequently inaccurate
and we never go back to revisit them anyway. We document issues to work
on properly in KNOWN_BUGS and TODO instead.

show more ...


Revision tags: curl-7_45_0, curl-7_44_0, curl-7_43_0, curl-7_42_1, curl-7_42_0
# 35648f2e 24-Mar-2015 Dan Fandrich

curl_memory: make curl_memory.h the second-last header file loaded

This header file must be included after all header files except
memdebug.h, as it does similar memory function redefini

curl_memory: make curl_memory.h the second-last header file loaded

This header file must be included after all header files except
memdebug.h, as it does similar memory function redefinitions and can be
similarly affected by conflicting definitions in system or dependent
library headers.

show more ...


Revision tags: curl-7_41_0, curl-7_40_0, curl-7_39_0, curl-7_38_0, curl-7_37_1, curl-7_37_0, curl-7_36_0, curl-7_35_0, curl-7_34_0, curl-7_33_0, curl-7_32_0
# 6bcacff1 19-Jul-2013 Yang Tse

WIN32 MemoryTracking: require UNICODE for wide strdup code support


# 90695fb2 18-Jul-2013 Yang Tse

Reinstate "WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage".

This reverts commit 7ed25cc, reinstating commit 8ec2cb5.

As of 18-jul-2013 we still do have code in l

Reinstate "WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage".

This reverts commit 7ed25cc, reinstating commit 8ec2cb5.

As of 18-jul-2013 we still do have code in libcurl that makes use of these
memory functions. Commit 8ec2cb5 comment still applies and is yet valid.

These memory functions are solely used in Windows builds, so all related
code is protected with '#ifdef WIN32' preprocessor conditional compilation
directives.

Specifically, wcsdup() _wcsdup() are used when building a Windows target with
UNICODE and USE_WINDOWS_SSPI preprocessor symbols defined. This is the case
when building a Windows UNICODE target with Windows native SSL/TLS support
enabled.

Realizing that wcsdup() _wcsdup() are used is a bit tricky given that usage
of these is hidden behind _tcsdup() which is MS way of dealing with code
that must tolerate UNICODE and non-UNICODE compilation. Additionally, MS
header files and those compatible from other compilers use this preprocessor
conditional compilation directive in order to select at compilation time
whether 'wide' or 'ansi' MS API functions are used.

Without this code, Windows build targets with Windows native SSL/TLS support
enabled and MemoryTracking support enabled misbehave in tracking memory usage,
regardless of being a UNICODE enabled build or not.

show more ...


Revision tags: curl-7_31_0
# 7ed25ccf 12-May-2013 Daniel Stenberg

Revert "WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage"

This reverts commit 8ec2cb5544b86306b702484ea785b6b9596562ab.

We don't have any code anywhere in libcurl

Revert "WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage"

This reverts commit 8ec2cb5544b86306b702484ea785b6b9596562ab.

We don't have any code anywhere in libcurl (or the curl tool) that use
wcsdup so there's no such memory use to track. It seems to cause mild
problems with the Borland compiler though that we may avoid by reverting
this change again.

Bug: http://curl.haxx.se/mail/lib-2013-05/0070.html

show more ...


Revision tags: curl-7_30_0
# 8ec2cb55 25-Mar-2013 Yang Tse

WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage

As of 25-mar-2013 wcsdup() _wcsdup() and _tcsdup() are only used in
WIN32 specific code, so tracking of these has not b

WIN32 MemoryTracking: track wcsdup() _wcsdup() and _tcsdup() usage

As of 25-mar-2013 wcsdup() _wcsdup() and _tcsdup() are only used in
WIN32 specific code, so tracking of these has not been extended for
other build targets. Without this fix, memory tracking system on
WIN32 builds, when using these functions, would provide misleading
results.

In order to properly extend this support for all targets curl.h
would have to define curl_wcsdup_callback prototype and consequently
wchar_t should be visible before that in curl.h. IOW curl_wchar_t
defined in curlbuild.h and this pulling whatever system header is
required to get wchar_t definition.

Additionally a new curl_global_init_mem() function that also receives
user defined wcsdup() callback would be required.

show more ...


# 001e664f 07-Feb-2013 Yang Tse

curl_memory.h: introduce CURLX_NO_MEMORY_CALLBACKS usage possibility

This commit alone does not fix anything nor modifies existing
interfaces or behaviors, although it is a prerequisite

curl_memory.h: introduce CURLX_NO_MEMORY_CALLBACKS usage possibility

This commit alone does not fix anything nor modifies existing
interfaces or behaviors, although it is a prerequisite for other
fixes.

show more ...


Revision tags: curl-7_29_0, curl-7_28_1, curl-7_28_0, curl-7_27_0, curl-7_26_0, curl-7_25_0, curl-7_24_0, curl-7_23_1, curl-7_23_0, curl-7_22_0, curl-7_21_7, curl-7_21_6, curl-7_21_5, curl-7_21_4, curl-7_21_3, curl-7_21_2, curl-7_21_1, curl-7_21_0, curl-7_20_1
# 2309b4e3 24-Mar-2010 Daniel Stenberg

remove the CVSish $Id$ lines


12