Commit Graph

23 Commits

Author SHA1 Message Date
Nicholas Nethercote
dc09fec388 Introduced get_pszB() to cover several common cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4154
2005-07-17 18:12:00 +00:00
Nicholas Nethercote
b04d33383d tweaks
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4153
2005-07-17 18:00:57 +00:00
Nicholas Nethercote
325aa03f8a Introduce get_bszB() and get_bszB_as_is() to factor out some common
combinations of function calls.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4152
2005-07-17 17:55:42 +00:00
Nicholas Nethercote
c7461d15cd Replace is_inuse_bszB() with is_inuse_block(), which is higher-level
and thus makes the code that uses it easier to understand.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4151
2005-07-17 17:20:30 +00:00
Nicholas Nethercote
7fb39f11e8 Rename 'other' as 'other_b' to make the fact it's a block more clear.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4150
2005-07-17 17:12:24 +00:00
Nicholas Nethercote
b9bec5539d Remove all the completely unused SF_* flags. I suspect some of the
remaining ones have no interesting effect, but I left them in.

Also simplify the signature for VG_(get_memory_from_mmap_for_client)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4045
2005-06-28 22:14:53 +00:00
Nicholas Nethercote
35fc371349 Malloc replacement worked very much like a 'need', but wasn't one.
I've changed it so it now is, which makes it consistent with the
other 'needs'.  Because of this, I was also able to invert the dependence
between m_mallocfree and m_tooliface, which is related to setting
the redzone size for client heap blocks.  As a result, m_tooliface
now doesn't depend on anything except pub_core_basics.h, hooray!
 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3979
2005-06-21 03:20:17 +00:00
Nicholas Nethercote
8fc121f908 Move VG_(get_memory_from_mmap_for_client) out of m_aspacemgr into
m_libcmman, next to VG_(get_memory_from_mmap).  Removes the (direct)
dependence of m_mallocfree on m_aspacemgr.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3962
2005-06-19 21:57:54 +00:00
Nicholas Nethercote
f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00
Nicholas Nethercote
82860347b1 Modularised the libc low-level memory management stuff (mmap, etc).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3891
2005-06-11 15:51:30 +00:00
Nicholas Nethercote
38d2799b5b Having moved VG_(arena_strdup)() out of core.h, core.h no longer
needs to #include pub_core_mallocfree.h.  As a result, we need
to #include it explicitly everywhere else.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3881
2005-06-11 01:31:52 +00:00
Nicholas Nethercote
7bf8160d24 Moved VG_(strdup)() and VG_(arena_strdup)() into m_mallocfree.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3878
2005-06-11 01:12:08 +00:00
Nicholas Nethercote
eb2d0a7d06 Modularised assertions and panics in m_libcassert.
As part of this, killed the VG_STRINGIFY macro, which was used to expand
out names like "VG_(foo)" and "vgPlain_foo" in assertion failure
messages.  This is good since we actually want the "VG_(foo)" form used
in these messages.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3842
2005-06-04 19:16:06 +00:00
Nicholas Nethercote
dbc8c6d99c Modularise printing functions in m_libcprint.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3840
2005-06-03 03:08:39 +00:00
Nicholas Nethercote
09980587a9 Started modularising vg_mylibc. Put all the standalone stuff -- ie. not
relying on any other modules -- in m_libcbase.

Also converted the 'size' parameters to functions like VG_(memcpy) and
VG_(strncpy) from Int to SizeT, as they should be.

Also removed VG_(atoll16) and VG_(toupper), which weren't being used.

Also made VG_(atoll36) less flexible -- it now only does base-36 numbers
instead of any base in the range 2..36, since base-36 is the only one we
need.  As part of that, I fixed a horrible bug in it which caused it to
return incorrect answers for any number containing the digits 'A'..'I'!
(Eg. for "A; it would return 17 instead of 10!)

Had to disable the assertions in VG_(string_match), since this module can't
see vg_assert, which wasn't ideal but also isn't a disaster.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3838
2005-06-02 03:39:33 +00:00
Nicholas Nethercote
5bdf595e70 Modularised the profiling stuff as m_profile.c. It's much more
sensible now -- no vg_dummy_profile.c, no silly #including of
vg_profile.c from tools.  

Unfortunately, it still doesn't work, due to bad interactions
with signal handling that I don't understand.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3833
2005-06-01 03:09:59 +00:00
Nicholas Nethercote
b3b8913e6e Comment-only changes: fix a typo, clarify another comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3803
2005-05-25 15:52:39 +00:00
Nicholas Nethercote
d806a12ed9 Concise-ify switch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3781
2005-05-21 19:36:45 +00:00
Julian Seward
b3e8c107c0 Small but critical performance fix from Pete Moceyunas: give
each small allocation size its own list.  Otherwise there can
be very long searches along lists looking for a block of the
right size.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3776
2005-05-19 10:54:01 +00:00
Nicholas Nethercote
937a49ea05 Added module m_options for holding all the command-line option stuff.
Perhaps parts of process_cmd_line_option() should go in here, but I've
not done that for now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3751
2005-05-16 23:31:24 +00:00
Nicholas Nethercote
92c61a5fd1 Don't mix backticks and apostrophes when quoting words -- eg. use 'foo'
rather than `foo', as www.cl.cam.ac.uk/~mgk25/ucs/quotes.html explains
we should (in more detail than you'd imagine was possible).  I did this
both in output messages and in some comments, for consistency.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3723
2005-05-15 17:28:26 +00:00
Nicholas Nethercote
944f1aa854 fixup headers a bit
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3717
2005-05-15 03:52:40 +00:00
Nicholas Nethercote
eb32bc7045 Modularised the malloc/free stuff into two modules: m_mallocfree for the
malloc/free implementation, and m_replacemalloc with the stuff for the tools
that replace malloc with their own version.  Previously these two areas of
functionality were mixed up somewhat.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3648
2005-05-10 02:47:21 +00:00