Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core/stdc/stdlib.d
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ else
// functions using these already have to be @trusted, allowing them to
// call @system stuff anyway.
///
void* malloc(size_t size) pure;
void* malloc(size_t size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Next step, please define a function pureMalloc that sets errno back to where it was for the current thread.

///
void* calloc(size_t nmemb, size_t size) pure;
void* calloc(size_t nmemb, size_t size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pureCalloc

///
void* realloc(void* ptr, size_t size) pure;
void* realloc(void* ptr, size_t size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pureRealloc

///
void free(void* ptr);

Expand Down
12 changes: 6 additions & 6 deletions src/core/sys/posix/stdlib.d
Original file line number Diff line number Diff line change
Expand Up @@ -122,42 +122,42 @@ version( CRuntime_Glibc )
int setenv(in char*, in char*, int);
int unsetenv(in char*);

void* valloc(size_t) pure; // LEGACY non-standard
void* valloc(size_t); // LEGACY non-standard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably these don't need to be wrapped

}
else version( Darwin )
{
int setenv(in char*, in char*, int);
int unsetenv(in char*);

void* valloc(size_t) pure; // LEGACY non-standard
void* valloc(size_t); // LEGACY non-standard
}
else version( FreeBSD )
{
int setenv(in char*, in char*, int);
int unsetenv(in char*);

void* valloc(size_t) pure; // LEGACY non-standard
void* valloc(size_t); // LEGACY non-standard
}
else version( OpenBSD )
{
int setenv(in char*, in char*, int);
int unsetenv(in char*);

void* valloc(size_t) pure; // LEGACY non-standard
void* valloc(size_t); // LEGACY non-standard
}
else version( CRuntime_Bionic )
{
int setenv(in char*, in char*, int);
int unsetenv(in char*);

void* valloc(size_t) pure;
void* valloc(size_t);
}
else version( Solaris )
{
int setenv(in char*, in char*, int);
int unsetenv(in char*);

void* valloc(size_t) pure; // LEGACY non-standard
void* valloc(size_t); // LEGACY non-standard
}

//
Expand Down