Skip to content

Commit

Permalink
Made libClose() free the TLS data of the current process.
Browse files Browse the repository at this point in the history
  • Loading branch information
salass00 committed Aug 6, 2017
1 parent d24d269 commit 2c97025
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
5 changes: 4 additions & 1 deletion init.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ STATIC struct Library *libOpen(struct LibraryManagerInterface *Self, ULONG versi
return libBase;
}

void tls_fast_path_cache_free(void);

/* Close the library */
STATIC BPTR libClose(struct LibraryManagerInterface *Self) {
struct Library *libBase = Self->Data.LibBase;

/* Free TLS data */
tls_fast_path_cache_free();

/* Make sure to undo what open did */

/* Make the close count */
Expand All @@ -78,7 +82,6 @@ STATIC BPTR libClose(struct LibraryManagerInterface *Self) {
return ZERO;
}


/* Expunge the library */
STATIC BPTR libExpunge(struct LibraryManagerInterface *Self) {
struct PixmanBase *libBase = (struct PixmanBase *)Self->Data.LibBase;
Expand Down
22 changes: 22 additions & 0 deletions pixman-0.34.0/pixman/pixman-compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,28 @@
result = tls_ ## name ## _alloc(); \
\
return result; \
} \
\
void \
tls_ ## name ## _free (void) \
{ \
struct Task *me = IExec->FindTask(NULL); \
struct Node *node; \
struct MemList *mlist; \
type *result = NULL; \
\
for (node = me->tc_MemEntry.lh_Head; node->ln_Succ; node = node->ln_Succ) \
{ \
mlist = (struct MemList *)node; \
if (mlist->ml_Node.ln_Name == tls_ ## name ## _id && \
mlist->ml_NumEntries == 1 && \
mlist->ml_ME[0].me_Length == sizeof(type)) \
{ \
IExec->Remove(&mlist->ml_Node); \
IExec->FreeEntry(mlist); \
return; \
} \
} \
}

# define PIXMAN_GET_THREAD_LOCAL(name) \
Expand Down
7 changes: 7 additions & 0 deletions releasenotes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ pixman-1.library 53.1 (29.7.2017)

- First version based on pixman 0.34.0.


pixman-1.library 53.2 (6.8.2017)

- Made libClose() free the TLS data of the current process. This should stop
dos.library from complaining about tc_Entry being non-empty on return when
the program has been run from the commandline or using IDOS->RunCommand().

0 comments on commit 2c97025

Please sign in to comment.