Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 58d43db

Browse files
author
philippe
committedMar 23, 2015
This patch further reduces the memory used by TT/TC (by about 15Mb
on 32 bits memcheck default nr of sectors). Memory is reduced by using UShort typedef-s for Sector no and TTE no. Note that for TTE no, we had a mixture of UShort, UInt and Int used depending on the place (a TTE no was in any case constrained to be an UShort). The bss memory/startup space is also reduced by allocating the htt on demand (like tt and tc), using mmap the first time a sector is initialised. Changes: * pub_core_transtab.h : * 2 typedef to identify a sector and a tt entry (these 2 types are UShort) * add 2 #define 'invalid values' for these types * change the interface to use these types rather than UInt * m_transtab.c * use wherever relevant these 2 new types rather than UInt or UShort * replace the use of -1 by INV_SNO or INV_TTE * remove now useless typecast from Int/UInt to UShort for tte * schedule.c: use the new types git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15036 a5019735-40e9-0310-863c-91ae7b9d1cf9
1 parent 2a59b4c commit 58d43db

File tree

3 files changed

+168
-137
lines changed

3 files changed

+168
-137
lines changed
 

‎coregrind/m_scheduler/scheduler.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,8 @@ void handle_chain_me ( ThreadId tid, void* place_to_chain, Bool toFastEP )
10481048
{
10491049
Bool found = False;
10501050
Addr ip = VG_(get_IP)(tid);
1051-
UInt to_sNo = (UInt)-1;
1052-
UInt to_tteNo = (UInt)-1;
1051+
SECno to_sNo = INV_SNO;
1052+
TTEno to_tteNo = INV_TTE;
10531053

10541054
found = VG_(search_transtab)( NULL, &to_sNo, &to_tteNo,
10551055
ip, False/*dont_upd_fast_cache*/ );
@@ -1070,8 +1070,8 @@ void handle_chain_me ( ThreadId tid, void* place_to_chain, Bool toFastEP )
10701070
}
10711071
}
10721072
vg_assert(found);
1073-
vg_assert(to_sNo != -1);
1074-
vg_assert(to_tteNo != -1);
1073+
vg_assert(to_sNo != INV_SNO);
1074+
vg_assert(to_tteNo != INV_TTE);
10751075

10761076
/* So, finally we know where to patch through to. Do the patching
10771077
and update the various admin tables that allow it to be undone

0 commit comments

Comments
 (0)
Please sign in to comment.