Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Merge remote-tracking branch 'upstream/master' into merge_master#1796

Merged
MartinNowak merged 136 commits intodlang:stablefrom
MartinNowak:merge_master
Mar 22, 2017
Merged

Merge remote-tracking branch 'upstream/master' into merge_master#1796
MartinNowak merged 136 commits intodlang:stablefrom
MartinNowak:merge_master

Conversation

@MartinNowak
Copy link
Member

No description provided.

Burgos and others added 30 commits November 3, 2016 22:53
This adds core.sys.linux.file module which contains
flock function definition and values of the parameters
to pass.
Implementing them (wrongly btw, ignoring the msg) leads to an implicit call to the `super` ctor of base class `core.stdcpp.exception.std.exception`, which is only declared in D. Even if the ctor signature was correct (see below), it's mangled differently (see dlang/dmd#5884), so there'd be an unresolved external anyway. So don't implement it, just declare it (also done for Glibc) to defer the linking error.

Quality-wise, the 2 `core.stdcpp` modules are at most at an alpha stage for MSVCRT. Other issues I've noted so far using **VS 2015**:
* The signature of the `core.stdcpp.exception.std.exception.this()` ctor is wrong. There's no default, i.e., parameter-less one, only `std::exception::exception(const char *_Message = "unknown", int x=1)`.
* `std::exception` only contains a pointer, no additional `bool` field.
* The signature of `core.stdcpp.typeinfo.std.type_info.name()` is wrong. It doesn't take any arguments.

The first 2 aren't crucial, as these C++ exceptions are most likely never constructed on the D side. But the last one will need to be fixed. @rainers: Which VS versions does DMD currently support?
This commit adds attributes to those functions
in `core.thread` that don't require changes
outside of the module.

Not much of this has profound effect to the users
but makes adding a templated `Thread`/`Fiber` classes
on the user's callback much easier later on,
which should help address the need for `@nogc` and
`nothrow` threading primitives.
This commit fixes `Thread.~this()`, `thread_attachThis`
and partially `thread_entryPoint` and `thread_attachByAddrB`.

`thread_entryPoint` can't be made `@nogc` because it calls
`Thread.run`, `rt_moduleTlsCtor` and `rt_moduleTlsDtor`,
which can execute arbitrary user code.

`thread_attachByAddrB` can't be made `@nogc` because
it calls `thread_findByAddr`, which calls `Thread.opApply`,
which can't be `@nogc` because it calls a non-`@nogc`
delegate.

This change is a bit large because many call-sites needed
to be fixed in one go:

* On posix, `thread_entryPoint` calls `inheritLoadedLibraries`
and `cleanupLoadedLibraries`, and `Thread.start` calls
`rt.sections.pinLoadedLibraries` and `unpinLoadedLibraries`.

* `Thread.~this()` calls `rt.tlsgc.destroy`, which in turn
calls `rt.sections.finiTLSRanges`, which is implemented
in `rt.secions_{platform}`.

* Similarly, `thread_attachThis` calls `rt.tlsgc.init`, which in
turn calls `rt.sections.initTLSRanges`, which is implemented
in `rt.secions_{platform}`. On some platforms
`rt.sections.initTLSRanges` calls `rt.minfo.ModuleGroup.this`,
so I made it `nothrow` and `@nogc` too.

* Additionally, `rt.sections.initSections` and `finiSections` were
easy to fix, so I added appropriate attributes to them, even
though they are called only from `rt.dmain2.rt_init`.

Finally, some function from `rt.sections_elf_shared` was accessing
`ModuleInfo.name` which wasn't marked as `@nogc`, so I went
through `object.ModuleInfo` and made all of its members
`@nogc` (they were already `nothrow`).
This commit adds attributes to Fiber.callImpl.

The call chain looks like this:
-> core.thread.Fiber.callImpl
  -> core.Fiber.switchIn
     -> core.Thread.pushContext/core.Thread.popContext
        -> core.thread.swapContext
           -> depending on the platform:
              -> rt.deh_win32/deh_win64_posix._d_eh_swapContext (On Windows and sometimes on Posix)
              -> rt.dwarfeh._d_eh_swapContextDwarf (on Posix)
[MSVCRT] core.stdcpp.typeinfo: Don't implement exception ctors
Workaround Issue 17081 - Bodies in extern cpp functions in D files are not linked
Merge remote-tracking branch 'upstream/stable' into merge_stable
Add linux-specific `core.sys.linux.file` module
Always use same-type pointers when subtracting them
Merge remote-tracking branch 'upstream/stable' into merge_stable
merged-on-behalf-of: Martin Nowak <code@dawg.eu>
Additionally add `shared` overloads to:
+ core.sys.windows.winbase:
  * EnterCriticalSection
  * LeaveCriticalSection
  * TryEnterCriticalSection
+ core.sys.posix.pthread:
  * pthread_mutex_lock
  * pthread_mutex_unlock
  * pthread_mutex_trylock

Also add `tryLock_nothrow` version of `Mutex.tryLock`.
* Also make the error messages more descriptive
andralex and others added 27 commits March 7, 2017 13:50
We already have the type with Args[i], so there's no need to ask args[i] for
its type.
- to avoid executor startvation, see dlang/ci#30
run pipeline outside of node block
[trivial] Small code simplification in core.time.
Remove dmd.conf target from CircleCi
NetBSD path
merged-on-behalf-of: David Nadlinger <code@klickverbot.at>
Add missing function to iconv.
merged-on-behalf-of: Martin Nowak <code@dawg.eu>
netbsd patch: core/sys/posix
merged-on-behalf-of: David Nadlinger <code@klickverbot.at>
_equals druntime template for structs
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
Fix issue 8411 - add opCast!bool support for Duration.
Remove a catch of Throwable in object.d
merged-on-behalf-of: Jonathan M Davis <jmdavis@users.noreply.github.com>
@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
17081 Bodies in extern cpp functions in D files are not linked

@MartinNowak MartinNowak merged commit 644d6fb into dlang:stable Mar 22, 2017
@MartinNowak MartinNowak deleted the merge_master branch March 22, 2017 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.